diff --git a/lib/extras/dec/gif.cc b/lib/extras/dec/gif.cc index cd6d273a..59c403a0 100644 --- a/lib/extras/dec/gif.cc +++ b/lib/extras/dec/gif.cc @@ -377,7 +377,7 @@ Status DecodeImageGIF(Span bytes, const ColorHints& color_hints, y * sub_frame_image.xsize; for (size_t x = 0; x < image_rect.xsize(); ++x, ++byte_index) { const GifByteType byte = image.RasterBits[byte_index]; - if (byte > color_map->ColorCount) { + if (byte >= color_map->ColorCount) { return JPEGLI_FAILURE("GIF color is out of bounds"); } if (byte == gcb.TransparentColor) {