diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-06-16 16:01:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-14 23:30:37 +0100 |
commit | 6aa01c06252a225073e7275aca0bd0b5f4db740a (patch) | |
tree | 3df4128e5a768ade3702fb9b7849a55e14302eb7 | |
parent | 00d5a4703925c4b3c8a3c5df73f984e6c4b9d3f4 (diff) | |
download | ffmpeg-6aa01c06252a225073e7275aca0bd0b5f4db740a.tar.gz |
avcodec/bintext: Check font height
Fixes: division by zero
Fixes: 15257/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINTEXT_fuzzer-5757352881422336
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bfb58bdd7015a6df2d130c92cf284d6a2362f3df)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/bintext.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c index d967317671..8e5c44446c 100644 --- a/libavcodec/bintext.c +++ b/libavcodec/bintext.c @@ -63,6 +63,10 @@ static av_cold int decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "not enough extradata\n"); return AVERROR_INVALIDDATA; } + if (!s->font_height) { + av_log(avctx, AV_LOG_ERROR, "invalid font height\n"); + return AVERROR_INVALIDDATA; + } } else { s->font_height = 8; s->flags = 0; |