]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/rasc: Check input size in decode_fint()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 17 Oct 2019 21:57:26 +0000 (23:57 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 9 Nov 2019 15:02:43 +0000 (16:02 +0100)
Fixes: Timeout (11sec -> 42ms)
Fixes: 18287/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5637866331308032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/rasc.c

index 21fc43f325c761a8f0fec0cd5b87d9baaa75f9e4..cdf20a6db9a55d7804687f28af4084a152f13e1b 100644 (file)
@@ -124,6 +124,8 @@ static int decode_fint(AVCodecContext *avctx,
         clear_plane(avctx, s->frame1);
         return 0;
     }
+    if (bytestream2_get_bytes_left(gb) < 72)
+        return AVERROR_INVALIDDATA;
 
     bytestream2_skip(gb, 8);
     w = bytestream2_get_le32(gb);