mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +00:00
LibGfx: Check bounds of color table access in TinyVGLoader
This commit is contained in:
parent
3c02e3ba09
commit
0b824ab7a6
|
@ -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…
Reference in a new issue