[FFmpeg-cvslog] tools/target_dec_fuzzer: Free parser in case of avcodec_open2() failure

Michael Niedermayer git at videolan.org
Sun Jul 21 15:06:25 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jul  7 22:50:42 2019 +0200| [508ce5839e0bf78ce8813eb1b38cce0d416a408e] | committer: Michael Niedermayer

tools/target_dec_fuzzer: Free parser in case of avcodec_open2() failure

Fixes: memleak
Fixes: part of 15529/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVPX_VP8_fuzzer-5140143700180992

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=508ce5839e0bf78ce8813eb1b38cce0d416a408e
---

 tools/target_dec_fuzzer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index e3ae3fd0ab..8ba25b4e8a 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -203,6 +203,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     if (res < 0) {
         av_free(ctx);
         av_free(parser_avctx);
+        av_parser_close(parser);
         return 0; // Failure of avcodec_open2() does not imply that a issue was found
     }
     parser_avctx->codec_id = ctx->codec_id;



More information about the ffmpeg-cvslog mailing list