LibGfx/ILBM: Avoid overflow when creating bitplane data buffer
This commit is contained in:
parent
5e1017bcf1
commit
b96a5f4265
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/b96a5f4265 Pull-request: https://github.com/SerenityOS/serenity/pull/21699 Reviewed-by: https://github.com/warpdesign
1 changed files with 1 additions and 1 deletions
|
@ -149,7 +149,7 @@ static ErrorOr<ByteBuffer> planar_to_chunky(ReadonlyBytes bitplanes, ILBMLoading
|
|||
u16 width = context.bm_header.width;
|
||||
u16 height = context.bm_header.height;
|
||||
u8 planes = context.bm_header.planes;
|
||||
auto chunky = TRY(ByteBuffer::create_zeroed(width * height));
|
||||
auto chunky = TRY(ByteBuffer::create_zeroed(static_cast<size_t>(width) * height));
|
||||
|
||||
for (u16 y = 0; y < height; y++) {
|
||||
size_t scanline = y * width;
|
||||
|
|
Loading…
Add table
Reference in a new issue