LibGfx: Assert that an empty bitmap is not created

This commit is contained in:
Shannon Booth 2020-02-11 21:18:40 +13:00 committed by Andreas Kling
parent cef3988e30
commit 7b6d450b6a
Notes: sideshowbarker 2024-07-19 09:26:59 +09:00

View file

@ -51,6 +51,7 @@ Bitmap::Bitmap(Format format, const Size& size, Purgeable purgeable)
, m_format(format)
, m_purgeable(purgeable == Purgeable::Yes)
{
ASSERT(!m_size.is_empty());
if (format == Format::Indexed8)
m_palette = new RGBA32[256];
int map_flags = purgeable == Purgeable::Yes ? (MAP_PURGEABLE | MAP_PRIVATE) : (MAP_ANONYMOUS | MAP_PRIVATE);