[FFmpeg-cvslog] xxan: Disallow odd width

Martin Storsjö git at videolan.org
Thu Jan 16 22:49:47 CET 2014


ffmpeg | branch: release/0.10 | Martin Storsjö <martin at martin.st> | Sun Sep 29 01:04:05 2013 +0300| [d3986f4f1baf8397c1f12154387c2c1950125d72] | committer: Luca Barbato

xxan: Disallow odd width

Decoded data is always written in pairs within this decoder.
This fixes writes out of bounds.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit aa0dd52434768da64f1f3d8ae92bcf980c1adffc)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

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

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

diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c
index 59e1229..e9c6169 100644
--- a/libavcodec/xxan.c
+++ b/libavcodec/xxan.c
@@ -46,6 +46,11 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
 
     avctx->pix_fmt = PIX_FMT_YUV420P;
 
+    if (avctx->width & 1) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid frame width: %d.\n", avctx->width);
+        return AVERROR(EINVAL);
+    }
+
     s->buffer_size = avctx->width * avctx->height;
     s->y_buffer = av_malloc(s->buffer_size);
     if (!s->y_buffer)



More information about the ffmpeg-cvslog mailing list