summaryrefslogtreecommitdiff
path: root/libavcodec/ansi.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-09-26 20:25:59 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-09-28 14:23:07 +0200
commit496267f8e9ec218351e4359e1fde48722d4fc804 (patch)
treed709a4952aa4b56f8e74fda11fe559ff4e1fa101 /libavcodec/ansi.c
parent9d738e6968757d4e70c8e07e0b720ac0004accc4 (diff)
downloadffmpeg-496267f8e9ec218351e4359e1fde48722d4fc804.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/ansi.c')
-rw-r--r--libavcodec/ansi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
index 4808ea7fff..19c88d8d51 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;
}