1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 21:35:07 +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

@ -734,6 +734,8 @@ static bool decode_png_adam7(PNGLoadingContext& context)
{
Streamer streamer(context.decompression_buffer, context.decompression_buffer_size);
context.bitmap = Bitmap::create_purgeable(context.has_alpha() ? BitmapFormat::RGBA32 : BitmapFormat::RGB32, { context.width, context.height });
if (!context.bitmap)
return false;
for (int pass = 1; pass <= 7; ++pass) {
if (!decode_adam7_pass(context, streamer, pass))