mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-31 23:22:03 +03:00
LibGfx: Reject ICOs with height == NumericLimits<i32>::min()
Bitmap files use negative height values to signify that the image should be rendered top down, but if the height value equals to the minimum value, negating it to get the actual height results in UB.
This commit is contained in:
parent
4a2cb70e83
commit
7572a355fd
Notes:
sideshowbarker
2024-07-18 17:12:44 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/7572a355fd4 Pull-request: https://github.com/SerenityOS/serenity/pull/7560
@ -210,6 +210,13 @@ static bool load_ico_bmp(ICOLoadingContext& context, ICOImageDescriptor& desc)
|
||||
printf("load_ico_bmp: width %d < 0\n", info.width);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (info.height == NumericLimits<i32>::min()) {
|
||||
if constexpr (ICO_DEBUG)
|
||||
printf("load_ico_bmp: height == NumericLimits<i32>::min()\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool topdown = false;
|
||||
if (info.height < 0) {
|
||||
topdown = true;
|
||||
|
Loading…
Reference in New Issue
Block a user