diff options
author | Nico Weber <thakis@chromium.org> | 2023-02-19 16:31:40 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-19 23:46:36 +0100 |
commit | 4bafdaba3f10a6d18a2c22b08c96eb6c21ad2ef5 (patch) | |
tree | 24b27b72e9dda0537252b284f3968d1907315e05 /Userland | |
parent | 51be9648842834a0abe6a4d96341987e51bfcdbe (diff) | |
download | serenity-4bafdaba3f10a6d18a2c22b08c96eb6c21ad2ef5.zip |
LibGfx: Make Lut16TagData and Lut8TagData ctors verify table sizes
The from_bytes() methods error out on invalid table sizes,
but let's make sure other potential future callers get it right too.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGfx/ICC/TagTypes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/ICC/TagTypes.h b/Userland/Libraries/LibGfx/ICC/TagTypes.h index db9431c6df..8b7a9d1a6a 100644 --- a/Userland/Libraries/LibGfx/ICC/TagTypes.h +++ b/Userland/Libraries/LibGfx/ICC/TagTypes.h @@ -201,6 +201,11 @@ public: { VERIFY(m_input_tables.size() == number_of_input_channels * number_of_input_table_entries); VERIFY(m_output_tables.size() == number_of_output_channels * number_of_output_table_entries); + + VERIFY(number_of_input_table_entries >= 2); + VERIFY(number_of_input_table_entries <= 4096); + VERIFY(number_of_output_table_entries >= 2); + VERIFY(number_of_output_table_entries <= 4096); } EMatrix3x3 const& e_matrix() const { return m_e; } @@ -255,6 +260,9 @@ public: { VERIFY(m_input_tables.size() == number_of_input_channels * number_of_input_table_entries); VERIFY(m_output_tables.size() == number_of_output_channels * number_of_output_table_entries); + + VERIFY(number_of_input_table_entries == 256); + VERIFY(number_of_output_table_entries == 256); } EMatrix3x3 const& e_matrix() const { return m_e; } |