mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +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
Notes:
sideshowbarker
2024-07-19 00:43:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3e0b913e44c
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
Reference in a new issue