summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2010-06-22 13:26:24 (GMT)
committerGunnar Sletta <gunnar.sletta@nokia.com>2010-06-23 05:25:21 (GMT)
commit08e2216a5157c5de30a65674051b08df6f2a1bf6 (patch)
treebd41d7aab4f3dd431ffa4095182ede9f4feb3641 /src/gui/painting/qpaintengine_raster.cpp
parent0eeb63be2737a5000ec703bf83fde47b64dfbedb (diff)
downloadQt-08e2216a5157c5de30a65674051b08df6f2a1bf6.zip
Qt-08e2216a5157c5de30a65674051b08df6f2a1bf6.tar.gz
Qt-08e2216a5157c5de30a65674051b08df6f2a1bf6.tar.bz2
Fixed crash in the fast blend functions for raster
The blend functions don't work when the scaling factor goes beyond 65536, so abort early. Strictly speaking the scale factor comes from targetWidth / sourceWidth, so this catches a bit more cases. Reviewed-by: Kim Task: http://bugreports.qt.nokia.com/browse/QTBUG-9437
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index a212718..94e5cbc 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2688,7 +2688,11 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
if (s->matrix.type() > QTransform::TxTranslate || stretch_sr) {
- if (s->flags.fast_images) {
+ QRectF targetBounds = s->matrix.mapRect(r);
+ bool exceedsPrecision = targetBounds.width() > 0xffff
+ || targetBounds.height() > 0xffff;
+
+ if (s->flags.fast_images && !exceedsPrecision) {
if (s->matrix.type() > QTransform::TxScale) {
SrcOverTransformFunc func = qTransformFunctions[d->rasterBuffer->format][img.format()];
if (func && (!clip || clip->hasRectClip)) {