From 478bd97b25e01193bb6d253938dfe8d0f1f92828 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 5 Jan 2023 15:09:31 -0500 Subject: [PATCH] LibGfx: Rename ICCHeader::profile_md5 to profile_id to match spec --- Userland/Libraries/LibGfx/ICCProfile.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibGfx/ICCProfile.cpp b/Userland/Libraries/LibGfx/ICCProfile.cpp index bcdb839c60..929b258fee 100644 --- a/Userland/Libraries/LibGfx/ICCProfile.cpp +++ b/Userland/Libraries/LibGfx/ICCProfile.cpp @@ -111,7 +111,7 @@ struct ICCHeader { BigEndian profile_creator; - u8 profile_md5[16]; + u8 profile_id[16]; u8 reserved[28]; }; static_assert(sizeof(ICCHeader) == 128); @@ -239,15 +239,15 @@ Optional parse_profile_id(ICCHeader const& header // ICC v4, 7.2.18 Profile ID field // "A profile ID field value of zero (00h) shall indicate that a profile ID has not been calculated." bool did_calculate_profile_id = false; - for (u8 b : header.profile_md5) + for (u8 b : header.profile_id) if (b != 0) did_calculate_profile_id = true; if (!did_calculate_profile_id) return {}; Crypto::Hash::MD5::DigestType md5; - static_assert(sizeof(md5.data) == sizeof(header.profile_md5)); - memcpy(md5.data, header.profile_md5, sizeof(md5.data)); + static_assert(sizeof(md5.data) == sizeof(header.profile_id)); + memcpy(md5.data, header.profile_id, sizeof(md5.data)); // FIXME: Consider comparing read id with compute_id() result and failing if they aren't equal.