mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +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:
parent
31b1e34342
commit
f048d38d38
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user