From f3ce959de6c682bdb7e71f7b82742f28a5be1e9c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 5 Oct 2016 15:45:55 +0200 Subject: 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 Reviewed-by: Gunnar Sletta --- src/gui/painting/qpaintengine_raster.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui') 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(); -- cgit v1.2.3