Workaround for GCC 16

This commit is contained in:
Michał Janiszewski
2026-05-05 21:35:30 +02:00
parent b8f638f5a3
commit 7e782373a4
+5 -2
View File
@@ -233,8 +233,11 @@ static RenderTarget CreateRT(const Viewport& viewport)
RenderTarget rt;
rt.width = viewport.width;
rt.height = viewport.height;
rt.bits = new (std::nothrow) PaletteIndex[rt.width * rt.height];
if (rt.bits == nullptr)
try
{
rt.bits = new PaletteIndex[rt.width * rt.height];
}
catch (...)
{
throw std::runtime_error("Giant screenshot failed, unable to allocate memory for image.");
}