Commit 8db90973 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/bintext: Check input size before allocating the input image

Fixes: Timeout
Fixes: 9795/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XBIN_fuzzer-5768631928487936

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 35517e3c
......@@ -146,6 +146,9 @@ static int decode_frame(AVCodecContext *avctx,
const uint8_t *buf_end = buf+buf_size;
int ret;
if ((avctx->width / FONT_WIDTH) * (avctx->height / s->font_height) / 256 > buf_size)
return AVERROR_INVALIDDATA;
s->x = s->y = 0;
if ((ret = ff_reget_buffer(avctx, s->frame)) < 0)
return ret;
......
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