1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/truemotion2rt: Check input buffer size

Fixes: Timeout
Fixes: 6250/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2RT_fuzzer-5479814011027456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2018-02-22 03:04:40 +01:00
parent 3981fb8d2a
commit 8b5c29b6c2

View File

@ -116,6 +116,9 @@ static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data,
if (ret < 0) if (ret < 0)
return ret; return ret;
if (avctx->width / s->hscale * avctx->height * s->delta_size > avpkt->size * 8LL * 4)
return AVERROR_INVALIDDATA;
ret = init_get_bits8(gb, avpkt->data + ret, avpkt->size - ret); ret = init_get_bits8(gb, avpkt->data + ret, avpkt->size - ret);
if (ret < 0) if (ret < 0)
return ret; return ret;