vcr1: check if dimensions are supported, fix out of array accesses.
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 17 Nov 2012 19:17:22 +0000 (20:17 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 17 Nov 2012 19:43:56 +0000 (20:43 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vcr1.c

index 2a4a090..acac925 100644 (file)
@@ -50,6 +50,10 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx)
 
     avctx->pix_fmt = AV_PIX_FMT_YUV410P;
 
+    if (avctx->width % 8 || avctx->height%4) {
+        av_log_ask_for_sample(avctx, "odd dimensions are not supported\n");
+        return AVERROR_PATCHWELCOME;
+    }
     return 0;
 }