summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Massimino <pascal.massimino@gmail.com>2020-12-26 12:16:15 +0100
committerSkal <skal@google.com>2020-12-26 12:26:41 +0100
commit8df77fb1b1e1682131af31e0403a26c2e37ac10f (patch)
treebdea5c616374dc5eab20a5259baac122c6e0cdda
parent63258823272806c8a401e2e3d36f96096f306c68 (diff)
downloadlibwebp-8df77fb1b1e1682131af31e0403a26c2e37ac10f.tar.gz
animdecoder_fuzzer: fix memory leak
BUG=oss-fuzz:28978 Change-Id: I7b3a495c02b4b03f367d732af5acb02856f8bead
-rw-r--r--tests/fuzzer/animdecoder_fuzzer.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/fuzzer/animdecoder_fuzzer.cc b/tests/fuzzer/animdecoder_fuzzer.cc
index 8846b303..d9988737 100644
--- a/tests/fuzzer/animdecoder_fuzzer.cc
+++ b/tests/fuzzer/animdecoder_fuzzer.cc
@@ -35,10 +35,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
if (dec == NULL) return 0;
WebPAnimInfo info;
- if (!WebPAnimDecoderGetInfo(dec, &info)) return 0;
+ if (!WebPAnimDecoderGetInfo(dec, &info)) goto End;
if (!ImgIoUtilCheckSizeArgumentsOverflow(info.canvas_width * 4,
info.canvas_height)) {
- return 0;
+ goto End;
}
while (WebPAnimDecoderHasMoreFrames(dec)) {
@@ -46,6 +46,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
int timestamp;
if (!WebPAnimDecoderGetNext(dec, &buf, &timestamp)) break;
}
+ End:
WebPAnimDecoderDelete(dec);
return 0;
}