summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-4.5.14
-rw-r--r--src/gui/painting/qwindowsurface.cpp7
2 files changed, 9 insertions, 2 deletions
diff --git a/dist/changes-4.5.1 b/dist/changes-4.5.1
index 4fb155a..bda151f 100644
--- a/dist/changes-4.5.1
+++ b/dist/changes-4.5.1
@@ -162,6 +162,10 @@ Third party components
sorting is disabled
* [248163] Fixed possible crash in the paintEvent when spans are used.
+- QWidget
+ * [250388] Fixed potential crash in QWidget::scroll() when using the raster
+ graphics system.
+
- QWizard
* [248107] Fixed bug on Vista causing Back button to connect twice to the back() signal.
diff --git a/src/gui/painting/qwindowsurface.cpp b/src/gui/painting/qwindowsurface.cpp
index bcb0380..d941a24 100644
--- a/src/gui/painting/qwindowsurface.cpp
+++ b/src/gui/painting/qwindowsurface.cpp
@@ -310,10 +310,13 @@ void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset)
int lineskip = img.bytesPerLine();
int depth = img.depth() >> 3;
-
- const QRect r = rect & QRect(0, 0, img.width(), img.height());
+ const QRect imageRect(0, 0, img.width(), img.height());
+ const QRect r = rect & imageRect & imageRect.translated(-offset);
const QPoint p = rect.topLeft() + offset;
+ if (r.isEmpty())
+ return;
+
const uchar *src;
uchar *dest;