]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/eamad.c
Merge commit '9cacdabd1c8cd257a942d8289349c37d992989b7'
[ffmpeg] / libavcodec / eamad.c
index 58cdea6753e3e15a54b77649fc1148d27af6c99c..b6bf86d307a04af83290e4da7d1a5f0e5e444478 100644 (file)
@@ -257,6 +257,11 @@ static int decode_frame(AVCodecContext *avctx,
     calc_quant_matrix(s, buf[13]);
     buf += 16;
 
+    if (width < 16 || height < 16) {
+        av_log(avctx, AV_LOG_ERROR, "Dimensions too small\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (avctx->width != width || avctx->height != height) {
         if((width * height)/2048*7 > buf_end-buf)
             return AVERROR_INVALIDDATA;