From 19df0996f567afdaef2faf0c91b89619747f8147 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 17 Nov 2021 01:24:10 +0100 Subject: [PATCH] scene: Do not clamp 1x1 windows Without the margins, they become 0x0 and we crash. --- src/scenes/opengl/scene_opengl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index 8b03f0d698..bf2f3a1bdc 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -1587,6 +1587,10 @@ static void clamp_sides(int left, int width, int right, const uint32_t *src, uin static void clamp(QImage &image, const QRect &viewport) { Q_ASSERT(image.depth() == 32); + if (viewport.isEmpty()) { + image = {}; + return; + } const QRect rect = image.rect();