mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
animdecoder_fuzzer: fix memory leak
BUG=oss-fuzz:28978
Change-Id: I7b3a495c02b4b03f367d732af5acb02856f8bead
(cherry picked from commit 8df77fb1b1
)
This commit is contained in:
parent
d6c2285d7c
commit
a92254107e
@ -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, ×tamp)) break;
|
||||
}
|
||||
End:
|
||||
WebPAnimDecoderDelete(dec);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user