mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:37:46 +00:00
LibGfx: Don't allow creating bitmaps whose sizes would overflow
If the area or size_in_bytes calculation for a Gfx::Bitmap would overflow, we now refuse to create such a bitmap and return nullptr. Thanks to @itamar8910 for finding this! :^)
This commit is contained in:
parent
a8406aa117
commit
228ace854c
5 changed files with 62 additions and 21 deletions
|
@ -80,7 +80,7 @@ static RefPtr<Gfx::Bitmap> s_background;
|
|||
|
||||
Card::Card(Type type, uint8_t value)
|
||||
: m_rect(Gfx::Rect({}, { width, height }))
|
||||
, m_front(Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, { width, height }))
|
||||
, m_front(*Gfx::Bitmap::create(Gfx::BitmapFormat::RGB32, { width, height }))
|
||||
, m_type(type)
|
||||
, m_value(value)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue