[FFmpeg-cvslog] eamad: Check against minimum supported dimensions

Michael Niedermayer git at videolan.org
Fri May 3 23:36:36 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May  3 23:16:54 2013 +0200| [e756635964ed3aa1ee997465f9b46143bcb5d894] | committer: Michael Niedermayer

eamad: Check against minimum supported dimensions

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e756635964ed3aa1ee997465f9b46143bcb5d894
---

 libavcodec/eamad.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 58cdea6..b6bf86d 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -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;



More information about the ffmpeg-cvslog mailing list