From b2cf773d85e82ccc6cb8d8c0477ccc115b26ac45 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 18 Feb 2023 21:30:50 -0500 Subject: [PATCH] LibGfx: Make TextDescriptionTagData verify input is 7-bit ASCII TextDescriptionTagData::from_bytes() errors out if that isn't the case, but let's make sure other potential future callers get it right too. --- Userland/Libraries/LibGfx/ICC/TagTypes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Libraries/LibGfx/ICC/TagTypes.h b/Userland/Libraries/LibGfx/ICC/TagTypes.h index ba81da61ac..9599c80d9c 100644 --- a/Userland/Libraries/LibGfx/ICC/TagTypes.h +++ b/Userland/Libraries/LibGfx/ICC/TagTypes.h @@ -732,6 +732,8 @@ public: , m_unicode_description(move(unicode_description)) , m_macintosh_description(move(macintosh_description)) { + for (u8 byte : ascii_description.bytes()) + VERIFY(byte < 128); } // Guaranteed to be 7-bit ASCII.