mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 11:36:22 +00:00
LibGfx/ICC: Avoid overflow when checking tag bounds
This commit is contained in:
parent
f02b84d34d
commit
c21efdfc8a
Notes:
sideshowbarker
2024-07-17 01:51:00 +09:00
Author: https://github.com/tcl3
Commit: c21efdfc8a
Pull-request: https://github.com/SerenityOS/serenity/pull/21360
Reviewed-by: https://github.com/nico ✅
1 changed files with 1 additions and 1 deletions
|
@ -560,7 +560,7 @@ static ErrorOr<NonnullRefPtr<TagData>> read_tag(ReadonlyBytes bytes, u32 offset_
|
|||
if (offset_to_beginning_of_tag_data_element % 4 != 0)
|
||||
return Error::from_string_literal("ICC::Profile: Tag data not aligned");
|
||||
|
||||
if (offset_to_beginning_of_tag_data_element + size_of_tag_data_element > bytes.size())
|
||||
if (static_cast<u64>(offset_to_beginning_of_tag_data_element) + size_of_tag_data_element > bytes.size())
|
||||
return Error::from_string_literal("ICC::Profile: Tag data out of bounds");
|
||||
|
||||
auto tag_bytes = bytes.slice(offset_to_beginning_of_tag_data_element, size_of_tag_data_element);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue