From b96a5f4265da953e888676dc72c3192f3d412ab1 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Mon, 30 Oct 2023 18:53:16 +0000 Subject: [PATCH] LibGfx/ILBM: Avoid overflow when creating bitplane data buffer --- Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp index 5ae0666aa0..0a0501b491 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/ILBMLoader.cpp @@ -149,7 +149,7 @@ static ErrorOr 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(width) * height)); for (u16 y = 0; y < height; y++) { size_t scanline = y * width;