summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-10-05 15:45:55 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-10-12 18:02:30 +0000
commitf3ce959de6c682bdb7e71f7b82742f28a5be1e9c (patch)
treecad2496f8a0eb2786213441b635ff6bdf98fafa2 /src/gui
parente732e432ab3b6741917cafa93117b8a9a04d6387 (diff)
Fix illegal memory access on simple image rotates
Clip the transformed and rounded sourceClip to the source rectangle, so we don't try to rotate pixels outside the source. Task-number: QTBUG-56252 Change-Id: Ib9cb80f9856724118867aea37ead0b02a6c71495 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index f87b052df2..83370be33f 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2273,6 +2273,8 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
= QRectF(sr.x() + clippedTargetRect.x() - r.x(), sr.y() + clippedTargetRect.y() - r.y(),
clippedTargetRect.width(), clippedTargetRect.height()).toRect();
+ clippedSourceRect = clippedSourceRect.intersected(img.rect());
+
uint dbpl = d->rasterBuffer->bytesPerLine();
uint sbpl = img.bytesPerLine();