LibWeb: Skip AddMask in display list player if destination rect is empty

...because otherwise Skia will fail to allocate empty surface.

Fixes crashing on https://null.com/games/chainstaff
This commit is contained in:
Aliaksandr Kalenik 2024-08-06 22:28:08 +03:00 committed by Andreas Kling
parent a8f4ea5226
commit 9f4deb57c8
Notes: github-actions[bot] 2024-08-06 20:17:05 +00:00

View file

@ -1280,6 +1280,9 @@ void DisplayListPlayerSkia::add_rounded_rect_clip(AddRoundedRectClip const& comm
void DisplayListPlayerSkia::add_mask(AddMask const& command)
{
auto const& rect = command.rect;
if (rect.is_empty())
return;
auto mask_surface = m_surface->make_surface(rect.width(), rect.height());
auto previous_surface = move(m_surface);