avcodec/dvdsubdec: discard accumulated buffer on error
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 5 Dec 2018 23:09:37 +0000 (00:09 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 14 Dec 2018 22:24:20 +0000 (23:24 +0100)
Fixes: Timeout
Fixes: 10992/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVDSUB_fuzzer-5657495410835456

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

index 632a53a..741ea9f 100644 (file)
@@ -595,6 +595,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
     }
 
     if (is_menu < 0) {
+        ctx->buf_size = 0;
     no_subtitle:
         reset_rects(sub);
         *data_size = 0;