mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 07:09:41 +00:00
LibGfx: Assert that an empty bitmap is not created
This commit is contained in:
parent
cef3988e30
commit
7b6d450b6a
Notes:
sideshowbarker
2024-07-19 09:26:59 +09:00
Author: https://github.com/shannonbooth
Commit: 7b6d450b6a
Pull-request: https://github.com/SerenityOS/serenity/pull/1209
Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 0 deletions
|
@ -51,6 +51,7 @@ Bitmap::Bitmap(Format format, const Size& size, Purgeable purgeable)
|
||||||
, m_format(format)
|
, m_format(format)
|
||||||
, m_purgeable(purgeable == Purgeable::Yes)
|
, m_purgeable(purgeable == Purgeable::Yes)
|
||||||
{
|
{
|
||||||
|
ASSERT(!m_size.is_empty());
|
||||||
if (format == Format::Indexed8)
|
if (format == Format::Indexed8)
|
||||||
m_palette = new RGBA32[256];
|
m_palette = new RGBA32[256];
|
||||||
int map_flags = purgeable == Purgeable::Yes ? (MAP_PURGEABLE | MAP_PRIVATE) : (MAP_ANONYMOUS | MAP_PRIVATE);
|
int map_flags = purgeable == Purgeable::Yes ? (MAP_PURGEABLE | MAP_PRIVATE) : (MAP_ANONYMOUS | MAP_PRIVATE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue