From 1db0883fea78f84b94c54b2562ed8666d5e06c91 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 15 Mar 2023 11:31:27 +0100 Subject: [PATCH] LibGfx: VERIFY correct type length in PNGChunk ctor --- Userland/Libraries/LibGfx/PNGWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibGfx/PNGWriter.cpp b/Userland/Libraries/LibGfx/PNGWriter.cpp index f07baccef0..8bd39aff4e 100644 --- a/Userland/Libraries/LibGfx/PNGWriter.cpp +++ b/Userland/Libraries/LibGfx/PNGWriter.cpp @@ -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(0)); MUST(store_type());