]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/truemotion2rt: Fix rounding in input size check
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 17 Nov 2018 08:24:30 +0000 (09:24 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 1 Dec 2018 00:58:27 +0000 (01:58 +0100)
Fixes: Timeout
Fixes: 11332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2RT_fuzzer-5678456612847616
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/truemotion2rt.c

index 9df0b527bbdfb6f66dccb633d87aec9b050792fa..e3ab998fda7cb37d8d61f7f03b85dd514998b900 100644 (file)
@@ -116,7 +116,7 @@ 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)
+    if ((avctx->width + s->hscale - 1)/ 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);