1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibGfx: VERIFY correct type length in PNGChunk ctor

This commit is contained in:
Nico Weber 2023-03-15 11:31:27 +01:00 committed by Linus Groh
parent bc248d28f7
commit 1db0883fea

View file

@ -48,6 +48,8 @@ private:
PNGChunk::PNGChunk(String type)
: m_type(move(type))
{
VERIFY(m_type.bytes().size() == 4);
// NOTE: These are MUST() because they should always be able to fit in m_data's inline capacity.
MUST(add_as_big_endian<data_length_type>(0));
MUST(store_type());