mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibGfx: Check bounds of color table access in TinyVGLoader
This commit is contained in:
parent
3c02e3ba09
commit
0b824ab7a6
1 changed files with 3 additions and 0 deletions
|
@ -205,6 +205,9 @@ public:
|
|||
{
|
||||
auto read_color = [&]() -> ErrorOr<Color> {
|
||||
auto color_index = TRY(m_stream.read_value<VarUInt>());
|
||||
if (color_index >= m_color_table.size())
|
||||
return Error::from_string_literal("Invalid color table index");
|
||||
|
||||
return m_color_table[color_index];
|
||||
};
|
||||
auto read_gradient = [&]() -> ErrorOr<NonnullRefPtr<SVGGradientPaintStyle>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue