[FFmpeg-cvslog] xldec: Check that width is a multiple of 4

Michael Niedermayer git at videolan.org
Sat Apr 21 21:57:41 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 21 21:29:48 2012 +0200| [94b42da6963a88c9518039e0b8ca42b6aab8bfb3] | committer: Michael Niedermayer

xldec: Check that width is a multiple of 4

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=94b42da6963a88c9518039e0b8ca42b6aab8bfb3
---

 libavcodec/xl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index 6cdb91b..c8b0e06 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -52,6 +52,11 @@ static int decode_frame(AVCodecContext *avctx,
     uint32_t val;
     int y0, y1, y2, y3 = 0, c0 = 0, c1 = 0;
 
+    if (avctx->width & 3) {
+        av_log(avctx, AV_LOG_ERROR, "width is not a multiple of 4\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if(p->data[0])
         avctx->release_buffer(avctx, p);
 



More information about the ffmpeg-cvslog mailing list