summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorChristoph Feck <christoph@maxiom.de>2009-10-28 08:57:53 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-10-28 08:57:53 (GMT)
commit5a5990b8cd3c580e3325a7c3878275196ceb86dd (patch)
tree4077b13e4fedac689e5e2d0920ba5aed3dfb12bb /src/gui/painting
parent75703aec3a8003b51df794ea5f0fa725a58b7861 (diff)
downloadQt-5a5990b8cd3c580e3325a7c3878275196ceb86dd.zip
Qt-5a5990b8cd3c580e3325a7c3878275196ceb86dd.tar.gz
Qt-5a5990b8cd3c580e3325a7c3878275196ceb86dd.tar.bz2
Fix raster paintengine handling with invalid images
initTexture() has explicit handling of invalid images, but when calling adjustSpanMethods() the invalid case is not handled for Type == Texture. This caused two types of crashes: * call to 0 address, because sourceFetch[] has 0 pointer for QImage::Format_Invalid (see https://bugs.kde.org/show_bug.cgi?id=176014) * division by zero in tiled blend functions, because of the " % image_size" modulo arithmetic. (see https://bugs.kde.org/show_bug.cgi?id=203231) Merge-request: 1213 Reviewed-by: Samuel Rødal <sroedal@trolltech.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 1a8dce1..8d0b961 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -5119,6 +5119,9 @@ void QSpanData::adjustSpanMethods()
#else
unclipped_blend = qBlendTexture;
#endif
+ if (!texture.imageData)
+ unclipped_blend = 0;
+
break;
}
// setup clipping