mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-30 18:05:36 +01:00 
			
		
		
		
	gifdec,Remap: avoid out of bounds colormap read
sanitize the requested length to be read against the reported size of the table BUG=webp:316 Change-Id: I1c471e93ab696a9d21a0142cf1987ffcf8f55dd2
This commit is contained in:
		| @@ -87,7 +87,8 @@ static void Remap(const GifFileType* const gif, const uint8_t* const src, | ||||
|   const GifColorType* colors; | ||||
|   const ColorMapObject* const cmap = | ||||
|       gif->Image.ColorMap ? gif->Image.ColorMap : gif->SColorMap; | ||||
|   if (cmap == NULL) return; | ||||
|   if (cmap == NULL || cmap->Colors == NULL) return; | ||||
|   if (len > cmap->ColorCount) len = cmap->ColorCount; | ||||
|   colors = cmap->Colors; | ||||
|  | ||||
|   for (i = 0; i < len; ++i) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user