avcodec/vp9: Check in decode_tiles() if there is data remaining
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 4 Aug 2018 20:21:02 +0000 (22:21 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 30 Oct 2018 02:13:25 +0000 (03:13 +0100)
Fixes: Timeout
Fixes: 9330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5707345857347584
Fixes: 9775/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5643845344690176

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/vp9.c

index b1178c9..acf3ffc 100644 (file)
@@ -1306,6 +1306,9 @@ static int decode_tiles(AVCodecContext *avctx,
                         decode_sb_mem(td, row, col, lflvl_ptr,
                                       yoff2, uvoff2, BL_64X64);
                     } else {
+                        if (vpX_rac_is_end(td->c)) {
+                            return AVERROR_INVALIDDATA;
+                        }
                         decode_sb(td, row, col, lflvl_ptr,
                                   yoff2, uvoff2, BL_64X64);
                     }