[FFmpeg-cvslog] xl: Make sure the width is valid

Luca Barbato git at videolan.org
Wed Sep 25 23:34:50 CEST 2013


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Sun Jul 28 18:24:15 2013 +0200| [8006716f215582ed396d9392809a174c26209f97] | committer: Sean McGovern

xl: Make sure the width is valid

CC: libav-stable at libav.org
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

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

diff --git a/libavcodec/xl.c b/libavcodec/xl.c
index 0ebc946..d45866d 100644
--- a/libavcodec/xl.c
+++ b/libavcodec/xl.c
@@ -69,6 +69,11 @@ static int decode_frame(AVCodecContext *avctx,
 
     stride = avctx->width - 4;
 
+    if (avctx->width % 4) {
+        av_log(avctx, AV_LOG_ERROR, "Width not a multiple of 4.\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     if (buf_size < avctx->width * avctx->height) {
         av_log(avctx, AV_LOG_ERROR, "Packet is too small\n");
         return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list