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

Michael Niedermayer git at videolan.org
Thu Jan 16 02:46:57 CET 2014


ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Fri May  3 23:16:54 2013 +0200| [6e3697b985520d3d0f6b2719446b9c2d1fb021ec] | 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>
(cherry picked from commit e756635964ed3aa1ee997465f9b46143bcb5d894)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index b9679bc..7a4908c 100644
--- a/libavcodec/eamad.c
+++ b/libavcodec/eamad.c
@@ -255,6 +255,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