mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
animdecoder_fuzzer: fix memory leak
BUG=oss-fuzz:28978 Change-Id: I7b3a495c02b4b03f367d732af5acb02856f8bead
This commit is contained in:
parent
6325882327
commit
8df77fb1b1
@ -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