1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:28:13 +00:00

LibGfx: Teach all image decoders to fail on bitmap allocation failure

We don't need to wait for oss-fuzz to find this for us. :^)
This commit is contained in:
Andreas Kling 2020-12-20 16:04:29 +01:00
parent 71d92cef17
commit c7d0c2ee7a
7 changed files with 27 additions and 2 deletions

View file

@ -292,6 +292,8 @@ static bool load_ico_bmp(ICOLoadingContext& context, ImageDescriptor& desc)
}
desc.bitmap = Bitmap::create_purgeable(BitmapFormat::RGBA32, { desc.width, desc.height });
if (!desc.bitmap)
return false;
Bitmap& bitmap = *desc.bitmap;
const u8* image_base = context.data + desc.offset + sizeof(info);
const BMP_ARGB* data_base = (const BMP_ARGB*)image_base;