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 2f034f255c)

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Luca Barbato 2013-07-22 12:44:19 +02:00
parent 12dc01bb1f
commit c25bbb6fdb
1 changed files with 6 additions and 0 deletions

View File

@ -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));