summaryrefslogtreecommitdiff
path: root/libavcodec/truemotion2rt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-22 03:04:40 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-27 19:37:06 +0100
commit8b5c29b6c2ab00f8fb545475238a99f575b5d81d (patch)
tree1d2bad3de6adc5f8452f0137aae3aaed630978a9 /libavcodec/truemotion2rt.c
parent3981fb8d2a03cdb3399590da8621a7bcc22e2964 (diff)
downloadffmpeg-8b5c29b6c2ab00f8fb545475238a99f575b5d81d.tar.gz
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>
Diffstat (limited to 'libavcodec/truemotion2rt.c')
-rw-r--r--libavcodec/truemotion2rt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/truemotion2rt.c b/libavcodec/truemotion2rt.c
index d63918742d..9df0b527bb 100644
--- a/libavcodec/truemotion2rt.c
+++ b/libavcodec/truemotion2rt.c
@@ -116,6 +116,9 @@ static int truemotion2rt_decode_frame(AVCodecContext *avctx, void *data,
if (ret < 0)
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);
if (ret < 0)
return ret;