diff options
author | Tristan Matthews <tmatth@videolan.org> | 2019-02-28 02:03:51 +0300 |
---|---|---|
committer | Tristan Matthews <tmatth@videolan.org> | 2019-02-28 19:06:52 +0300 |
commit | 8c9e086ce9f29008c751dd9dfa8ddfcf400cff1f (patch) | |
tree | 2929d0ea72a9ba2835849eca6ef9703709730b65 | |
parent | 22fd1448f0c6fc8a7c2a5aee497d1ce6a6f27cce (diff) |
oss-fuzz: avoid leak on error
-rw-r--r-- | contrib/oss-fuzz/speexdec_fuzzer.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/oss-fuzz/speexdec_fuzzer.cc b/contrib/oss-fuzz/speexdec_fuzzer.cc index f2639b3..5b1229f 100644 --- a/contrib/oss-fuzz/speexdec_fuzzer.cc +++ b/contrib/oss-fuzz/speexdec_fuzzer.cc @@ -222,7 +222,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *fuzz_data, size_t fuzz_size { st = process_header(&op, enh_enabled, &frame_size, &granule_frame_size, &rate, &nframes, &channels, &stereo, &extra_headers); if (!st) - return 0; + { + speex_bits_destroy(&bits); + if (stream_init) + ogg_stream_clear(&os); + ogg_sync_clear(&oy); + return 0; + } speex_decoder_ctl(st, SPEEX_GET_LOOKAHEAD, &lookahead); if (!nframes) nframes=1; |