[FFmpeg-cvslog] tools/target_dem_fuzzer: Fix packet leak
Michael Niedermayer
git at videolan.org
Thu Apr 1 12:50:17 EEST 2021
ffmpeg | branch: release/4.4 | Michael Niedermayer <michael at niedermayer.cc> | Mon Mar 22 21:58:30 2021 +0100| [15f1648f7fe65aadea4bfc1e2a72feaf30110aa0] | committer: Michael Niedermayer
tools/target_dem_fuzzer: Fix packet leak
Fixes: 32121/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-4512973109460992
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 6055b93379fd29477afa8f24881223a14e2f6b81)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15f1648f7fe65aadea4bfc1e2a72feaf30110aa0
---
tools/target_dem_fuzzer.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tools/target_dem_fuzzer.c b/tools/target_dem_fuzzer.c
index af1840b359..3c03c8d17c 100644
--- a/tools/target_dem_fuzzer.c
+++ b/tools/target_dem_fuzzer.c
@@ -186,10 +186,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
ret = avformat_open_input(&avfmt, filename, fmt, NULL);
if (ret < 0) {
- av_freep(&fuzzed_pb->buffer);
- av_freep(&fuzzed_pb);
- avformat_free_context(avfmt);
- return 0;
+ goto fail;
}
ret = avformat_find_stream_info(avfmt, NULL);
@@ -203,10 +200,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
av_packet_unref(pkt);
}
+fail:
av_packet_free(&pkt);
av_freep(&fuzzed_pb->buffer);
avio_context_free(&fuzzed_pb);
avformat_close_input(&avfmt);
return 0;
+
}
More information about the ffmpeg-cvslog
mailing list