mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
LibGfx/BMPLoader: Make sure height passed to Gfx::Bitmap is positive
BMP files encode the direction of the rows with the sign of the height. Our BMP decoder already makes all the proper checks, however when constructing the Gfx::Bitmap, didn't actually make the height positive. Boog neutralized :^)
This commit is contained in:
parent
99217bf6db
commit
a9208a18ca
Notes:
sideshowbarker
2024-07-17 07:25:39 +09:00
Author: https://github.com/circl-lastname
Commit: a9208a18ca
Pull-request: https://github.com/SerenityOS/serenity/pull/21490
1 changed files with 1 additions and 1 deletions
|
@ -1271,7 +1271,7 @@ static ErrorOr<void> decode_bmp_pixel_data(BMPLoadingContext& context)
|
|||
}
|
||||
|
||||
u32 const width = abs(context.dib.core.width);
|
||||
u32 const height = !context.is_included_in_ico ? context.dib.core.height : (context.dib.core.height / 2);
|
||||
u32 const height = !context.is_included_in_ico ? abs(context.dib.core.height) : (abs(context.dib.core.height) / 2);
|
||||
|
||||
context.bitmap = TRY(Bitmap::create(format, { static_cast<int>(width), static_cast<int>(height) }));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue