mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
LibGfx: Fail PNG decode if output bitmap can't be allocated
Otherwise we'll assert soon afterwards. Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28838
This commit is contained in:
parent
6e0976d858
commit
3e0b913e44
1 changed files with 5 additions and 0 deletions
|
@ -617,6 +617,11 @@ static bool decode_png_bitmap_simple(PNGLoadingContext& context)
|
|||
|
||||
context.bitmap = Bitmap::create_purgeable(context.has_alpha() ? BitmapFormat::RGBA32 : BitmapFormat::RGB32, { context.width, context.height });
|
||||
|
||||
if (!context.bitmap) {
|
||||
context.state = PNGLoadingContext::State::Error;
|
||||
return false;
|
||||
}
|
||||
|
||||
unfilter(context);
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue