mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 15:32:53 +01:00
Revert "gifdec,Remap: avoid out of bounds colormap read"
This reverts commit f048d38d380ef042bb1b5f3a2e5ecc729a5c826a. the 'len' in Remap refers to the src[] not the colormap; this change breaks valid files BUG=webp:316 Change-Id: I1ed40075c2194df91d345cb6f29619b1f5cc96fc
This commit is contained in:
parent
fb52d4432a
commit
4595e01fd0
@ -87,8 +87,7 @@ 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 || cmap->Colors == NULL) return;
|
||||
if (len > cmap->ColorCount) len = cmap->ColorCount;
|
||||
if (cmap == NULL) return;
|
||||
colors = cmap->Colors;
|
||||
|
||||
for (i = 0; i < len; ++i) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user