escape130: Check dimensions to be a multiple of the block size.
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 8 Dec 2011 12:38:13 +0000 (13:38 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 8 Dec 2011 17:31:21 +0000 (18:31 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/escape130.c

index 1198010..e7ba7bd 100644 (file)
@@ -43,6 +43,11 @@ static av_cold int escape130_decode_init(AVCodecContext *avctx)
     Escape130Context *s = avctx->priv_data;
     avctx->pix_fmt = PIX_FMT_YUV420P;
 
+    if((avctx->width&1) || (avctx->height&1)){
+        av_log(avctx, AV_LOG_ERROR, "Dimensions are not a multiple of the block size\n");
+        return AVERROR(EINVAL);
+    }
+
     s->bases= av_malloc(avctx->width * avctx->height /4);
 
     return 0;