mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibGfx/TIFF: Don't crash on invalid indices inside RGBPalette images
We were previously accessing a Vector's element using a user-provided value as index input.
This commit is contained in:
parent
58bdca96cd
commit
0ef449a588
1 changed files with 3 additions and 0 deletions
|
@ -189,6 +189,9 @@ private:
|
|||
|
||||
auto const color_map = *m_metadata.color_map();
|
||||
|
||||
if (blue_offset + index >= color_map.size())
|
||||
return Error::from_string_literal("TIFFImageDecoderPlugin: Color index is out of range");
|
||||
|
||||
// FIXME: ColorMap's values are always 16-bits, stop truncating them when we support 16 bits bitmaps
|
||||
return Color(
|
||||
color_map[red_offset + index] >> 8,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue