diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-09-26 20:25:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-09-28 17:11:52 +0200 |
commit | e5bf7ab3e7c6432da47958105ac59ee2681d3198 (patch) | |
tree | 588646b768362d88815dfde6e66876be15c80757 /libavcodec | |
parent | 63f951601e75051085b85e8034989ee8a7dcff1d (diff) | |
download | ffmpeg-e5bf7ab3e7c6432da47958105ac59ee2681d3198.tar.gz |
avcodec/ansi: Check dimensions
Fixes: 1.avi
Found-by: 连一汉 <lianyihan@360.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 69449da436169e7facaa6d1f3bcbc41cf6ce2754)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ansi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index 21d5ae1db2..98ea9e3d2a 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -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; } |