From cc2008ea0dc3b7d931204182d8a629812daa9b3d Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Fri, 1 Dec 2023 00:49:53 +0100 Subject: [PATCH] LibWeb: Skip painting of empty stacking contexts in GPU painter Fixes crashing on https://twinings.co.uk/ that was happening because of 0 size texture allocation. --- .../Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp b/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp index 29fbd4aa4c..cc3cfb78e4 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorGPU.cpp @@ -93,6 +93,9 @@ CommandResult PaintingCommandExecutorGPU::set_font(Gfx::Font const&) CommandResult PaintingCommandExecutorGPU::push_stacking_context(float opacity, bool is_fixed_position, Gfx::IntRect const& source_paintable_rect, Gfx::IntPoint post_transform_translation, CSS::ImageRendering, StackingContextTransform transform, Optional) { + if (source_paintable_rect.is_empty()) + return CommandResult::SkipStackingContext; + m_stacking_contexts.last().stacking_context_depth++; painter().save(); if (is_fixed_position) {