diff --git a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h index 0eb5956c00..1ee3302380 100644 --- a/Userland/Libraries/LibGfx/ICC/BinaryFormat.h +++ b/Userland/Libraries/LibGfx/ICC/BinaryFormat.h @@ -75,6 +75,10 @@ struct ICCHeader { }; static_assert(AssertSize()); +// ICC v4, 7.2.9 Profile file signature field +// "The profile file signature field shall contain the value “acsp” (61637370h) as a profile file signature." +constexpr u32 ProfileFileSignature = 0x61637370; + // Common bits of ICC v4, Table 40 — lut16Type encoding and Table 44 — lut8Type encoding struct LUTHeader { u8 number_of_input_channels; diff --git a/Userland/Libraries/LibGfx/ICC/Profile.cpp b/Userland/Libraries/LibGfx/ICC/Profile.cpp index dc2f52c81e..39cc109710 100644 --- a/Userland/Libraries/LibGfx/ICC/Profile.cpp +++ b/Userland/Libraries/LibGfx/ICC/Profile.cpp @@ -179,8 +179,7 @@ ErrorOr parse_creation_date_time(ICCHeader const& header) ErrorOr parse_file_signature(ICCHeader const& header) { // ICC v4, 7.2.9 Profile file signature field - // "The profile file signature field shall contain the value “acsp” (61637370h) as a profile file signature." - if (header.profile_file_signature != 0x61637370) + if (header.profile_file_signature != ProfileFileSignature) return Error::from_string_literal("ICC::Profile: profile file signature not 'acsp'"); return {}; }