1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 00:57:44 +00:00

LibGfx+icc: Look at profile_size field

This trims the input bytes to the profile size stored in the file.
Alternatively, we could reject files where the stored size doesn't
match the handed in size. But ICC profiles can be embedded in other
files, and those could conceivably pad the ICC profile data some.
This commit is contained in:
Nico Weber 2023-01-08 07:07:21 -05:00 committed by Linus Groh
parent 7d4ec4fecf
commit 7ae97c9fc4
3 changed files with 29 additions and 0 deletions

View file

@ -223,6 +223,7 @@ public:
// For non-DeviceLink profiles, always PCSXYZ or PCSLAB.
ColorSpace connection_space() const { return m_connection_space; }
u32 on_disk_size() const { return m_on_disk_size; }
time_t creation_timestamp() const { return m_creation_timestamp; }
PrimaryPlatform primary_platform() const { return m_primary_platform; }
Flags flags() const { return m_flags; }
@ -237,6 +238,7 @@ public:
static Crypto::Hash::MD5::DigestType compute_id(ReadonlyBytes);
private:
u32 m_on_disk_size { 0 };
Optional<PreferredCMMType> m_preferred_cmm_type;
Version m_version;
DeviceClass m_device_class;