Commit 69449da4 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/ansi: Check dimensions

Fixes: 1.avi
Found-by: 's avatar连一汉 <lianyihan@360.cn>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 99b823f0
......@@ -94,6 +94,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
if (ret < 0)
return ret;
} else if (avctx->width % FONT_WIDTH || avctx->height % s->font_height) {
av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %d %d\n", avctx->width, avctx->height);
return AVERROR(EINVAL);
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment