From 2a997a58cf31be8ed0e90468210847bdb5ef0c4c Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sun, 5 Jun 2022 01:02:17 +0300 Subject: [PATCH] return default QPainterPath object in case rectangles vector is empty in qt_regionToPath() function fixes assert when build for debugging Signed-off-by: Ivailo Monev --- src/gui/painting/qregion.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index 4a7d97c7f..36606824f 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -855,6 +855,9 @@ Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion ®ion) } const QVector rects = region.rects(); + if (rects.size() <= 0) { + return result; + } QSTACKARRAY(Segment, segments, 4 * rects.size()); -- 2.11.0