mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:45: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:
parent
71d92cef17
commit
c7d0c2ee7a
7 changed files with 27 additions and 2 deletions
|
@ -319,6 +319,10 @@ static bool read_image_data(PPMLoadingContext& context, Streamer& streamer)
|
|||
return false;
|
||||
|
||||
context.bitmap = Bitmap::create_purgeable(BitmapFormat::RGB32, { context.width, context.height });
|
||||
if (!context.bitmap) {
|
||||
context.state = PPMLoadingContext::State::Error;
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t index = 0;
|
||||
for (int y = 0; y < context.height; ++y) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue