mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
This commit is contained in:
parent
f0409081f5
commit
c7d891765c
131 changed files with 422 additions and 421 deletions
|
@ -1185,7 +1185,7 @@ static bool decode_bmp_pixel_data(BMPLoadingContext& context)
|
|||
|
||||
const u32 width = abs(context.dib.core.width);
|
||||
const u32 height = abs(context.dib.core.height);
|
||||
context.bitmap = Bitmap::create_purgeable(format, { static_cast<int>(width), static_cast<int>(height) });
|
||||
context.bitmap = Bitmap::try_create_purgeable(format, { static_cast<int>(width), static_cast<int>(height) });
|
||||
if (!context.bitmap) {
|
||||
dbgln("BMP appears to have overly large dimensions");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue