mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 18:35:41 +01:00 
			
		
		
		
	animdecoder_fuzzer: fix memory leak
BUG=oss-fuzz:28978
Change-Id: I7b3a495c02b4b03f367d732af5acb02856f8bead
(cherry picked from commit 8df77fb1b1)
			
			
This commit is contained in:
		
				
					committed by
					
						 James Zern
						James Zern
					
				
			
			
				
	
			
			
			
						parent
						
							d6c2285d7c
						
					
				
				
					commit
					a92254107e
				
			| @@ -35,10 +35,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | |||||||
|   if (dec == NULL) return 0; |   if (dec == NULL) return 0; | ||||||
|  |  | ||||||
|   WebPAnimInfo info; |   WebPAnimInfo info; | ||||||
|   if (!WebPAnimDecoderGetInfo(dec, &info)) return 0; |   if (!WebPAnimDecoderGetInfo(dec, &info)) goto End; | ||||||
|   if (!ImgIoUtilCheckSizeArgumentsOverflow(info.canvas_width * 4, |   if (!ImgIoUtilCheckSizeArgumentsOverflow(info.canvas_width * 4, | ||||||
|                                            info.canvas_height)) { |                                            info.canvas_height)) { | ||||||
|     return 0; |     goto End; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   while (WebPAnimDecoderHasMoreFrames(dec)) { |   while (WebPAnimDecoderHasMoreFrames(dec)) { | ||||||
| @@ -46,6 +46,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | |||||||
|     int timestamp; |     int timestamp; | ||||||
|     if (!WebPAnimDecoderGetNext(dec, &buf, ×tamp)) break; |     if (!WebPAnimDecoderGetNext(dec, &buf, ×tamp)) break; | ||||||
|   } |   } | ||||||
|  |  End: | ||||||
|   WebPAnimDecoderDelete(dec); |   WebPAnimDecoderDelete(dec); | ||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user