mirror of https://git.ffmpeg.org/ffmpeg.git
tools/target_dem_fuzzer: Fix packet leak
Fixes: 32121/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-4512973109460992
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6055b93379
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
45f40cec3a
commit
15f1648f7f
|
@ -186,10 +186,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||||
|
|
||||||
ret = avformat_open_input(&avfmt, filename, fmt, NULL);
|
ret = avformat_open_input(&avfmt, filename, fmt, NULL);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_freep(&fuzzed_pb->buffer);
|
goto fail;
|
||||||
av_freep(&fuzzed_pb);
|
|
||||||
avformat_free_context(avfmt);
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = avformat_find_stream_info(avfmt, NULL);
|
ret = avformat_find_stream_info(avfmt, NULL);
|
||||||
|
@ -203,10 +200,12 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||||
av_packet_unref(pkt);
|
av_packet_unref(pkt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fail:
|
||||||
av_packet_free(&pkt);
|
av_packet_free(&pkt);
|
||||||
av_freep(&fuzzed_pb->buffer);
|
av_freep(&fuzzed_pb->buffer);
|
||||||
avio_context_free(&fuzzed_pb);
|
avio_context_free(&fuzzed_pb);
|
||||||
avformat_close_input(&avfmt);
|
avformat_close_input(&avfmt);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue