[FFmpeg-devel,1/4] tools/target_dec_fuzzer: Free parser in case of avcodec_open2() failure

Submitted by Michael Niedermayer on July 7, 2019, 11:18 p.m.

Details

Message ID 20190707231805.29267-1-michael@niedermayer.cc
State Accepted
Commit 508ce5839e0bf78ce8813eb1b38cce0d416a408e
Headers show

Commit Message

Michael Niedermayer July 7, 2019, 11:18 p.m.
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@niedermayer.cc>
---
 tools/target_dec_fuzzer.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer July 21, 2019, 9:26 a.m.
On Mon, Jul 08, 2019 at 01:18:02AM +0200, Michael Niedermayer wrote:
> 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@niedermayer.cc>
> ---
>  tools/target_dec_fuzzer.c | 1 +
>  1 file changed, 1 insertion(+)

will apply

[...]

Patch hide | download patch | download mbox

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index f456db0e7b..51a4ba78d0 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;