1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +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

@ -67,5 +67,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
out_optional("creator", profile->creator());
out_optional("id", profile->id());
size_t profile_disk_size = icc_file->size();
if (profile_disk_size != profile->on_disk_size()) {
VERIFY(profile_disk_size > profile->on_disk_size());
outln("{} trailing bytes after profile data", profile_disk_size - profile->on_disk_size());
}
return 0;
}