Skip to content

Commit

Permalink
LibGfx/ILBM: Avoid overflow when creating bitplane data buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
tcl3 authored and awesomekling committed Nov 8, 2023
1 parent 5e1017b commit b96a5f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b96a5f4

Please sign in to comment.