mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibGfx: Rename ICCHeader::profile_md5 to profile_id to match spec
This commit is contained in:
parent
cbad79fa86
commit
478bd97b25
Notes:
sideshowbarker
2024-07-17 04:32:07 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/478bd97b25 Pull-request: https://github.com/SerenityOS/serenity/pull/16863 Reviewed-by: https://github.com/linusg
|
@ -111,7 +111,7 @@ struct ICCHeader {
|
|||
|
||||
BigEndian<u32> profile_creator;
|
||||
|
||||
u8 profile_md5[16];
|
||||
u8 profile_id[16];
|
||||
u8 reserved[28];
|
||||
};
|
||||
static_assert(sizeof(ICCHeader) == 128);
|
||||
|
@ -239,15 +239,15 @@ Optional<Crypto::Hash::MD5::DigestType> 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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue