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-07-23 23:03:37 +0200
commit2f034f255c49050e894ab9b88087c09ebe249f3f (patch)
tree1fefbfea31b51abc4575de6f0734c666927b3e8f /libavcodec
parentca488ad480360dfafcb5766f7bfbb567a0638979 (diff)
downloadffmpeg-2f034f255c49050e894ab9b88087c09ebe249f3f.tar.gz
4xm: Reject not a multiple of 16 dimension
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.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 a4e6965fe0..1489c32426 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -807,6 +807,12 @@ static int decode_frame(AVCodecContext *avctx, void *data,
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));