[FFmpeg-cvslog] avcodec/truemotion2rt: Check input buffer size
Michael Niedermayer
git at videolan.org
Tue Feb 27 20:38:22 EET 2018
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Feb 22 03:04:40 2018 +0100| [8b5c29b6c2ab00f8fb545475238a99f575b5d81d] | committer: Michael Niedermayer
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 at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8b5c29b6c2ab00f8fb545475238a99f575b5d81d
---
libavcodec/truemotion2rt.c | 3 +++
1 file changed, 3 insertions(+)
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;
More information about the ffmpeg-cvslog
mailing list