aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-07-22 12:44:19 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-09-29 22:37:12 +0200
commitc25bbb6fdbfb7332af302e0366fc2c2d60b44c72 (patch)
tree9fa6fd04618f603e9130d1f8abdf7ab5ba7399d2 /libavcodec
parent12dc01bb1f07112cd7eb31e183d75cb3c0fb92ca (diff)
downloadffmpeg-c25bbb6fdbfb7332af302e0366fc2c2d60b44c72.tar.gz
4xm: Reject not a multiple of 16 dimension
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 2f034f255c49050e894ab9b88087c09ebe249f3f) Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/4xm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 3d026febe3..159ca9ce29 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -750,6 +750,12 @@ static int decode_frame(AVCodecContext *avctx,
if (buf_size < 20)
return AVERROR_INVALIDDATA;
+ if (avctx->width % 16 || avctx->height % 16) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Dimensions non-multiple of 16 are invalid.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (buf_size < AV_RL32(buf + 4) + 8) {
av_log(f->avctx, AV_LOG_ERROR,
"size mismatch %d %d\n", buf_size, AV_RL32(buf + 4));