From d865129d9ea9f15d27bd1cc05058c95c17e23ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 11 Mar 2022 14:20:11 +0100 Subject: [PATCH] Painting: Fix value check in isUnclipped() left() == INT_MIN or top() == INT_MIN will still underflow in QRect's ctor, so the check must be more strict Pick-to: 6.2 6.3 Change-Id: I12ab148934c8c90865ca9247bd8badeedd4a9f45 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index eb4fce26730..bbd9c18e3c5 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3005,7 +3005,7 @@ inline bool QRasterPaintEnginePrivate::isUnclipped(const QRectF &rect, int penWidth) const { const QRectF norm = rect.normalized(); - if (norm.left() < INT_MIN || norm.top() < INT_MIN + if (norm.left() <= INT_MIN || norm.top() <= INT_MIN || norm.right() > INT_MAX || norm.bottom() > INT_MAX || norm.width() > INT_MAX || norm.height() > INT_MAX) return false;