From 0e66a5c3edc787b1f6ba31eb64db56ec09010c0e Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 18 Feb 2023 22:10:52 -0500 Subject: [PATCH] LibGfx: Write multiLocalizedUnicodeType with multiple strings correctly Found by reencoding Tests/LibGfx/test-inputs/icc-v2.png, the 'dscm' tag. --- Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp b/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp index a1f8861777..2e0f132459 100644 --- a/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp +++ b/Userland/Libraries/LibGfx/ICC/BinaryWriter.cpp @@ -112,7 +112,7 @@ static ErrorOr encode_multi_localized_unicode(MultiLocalizedUnicodeT records[i].country_code = tag_data.records()[i].iso_3166_1_country_code; records[i].string_length_in_bytes = utf16_strings[i].size() * sizeof(u16); records[i].string_offset_in_bytes = offset; - offset += records[i].string_offset_in_bytes; + offset += records[i].string_length_in_bytes; } auto* string_table = bit_cast*>(bytes.data() + header_and_record_size);