summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-02-22 18:24:44 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-02-22 18:24:44 (GMT)
commit3f960aa1cf396e5206a6c28e68097257625c1df9 (patch)
tree9cee4f1d03b4126deb35f40fb407d1ab00e06240 /src/gui/painting
parent668499a22e7e5f166a001fe77dd709d24d0183ea (diff)
parent9d019830169289a3aa00e8baca9c320963904993 (diff)
downloadQt-3f960aa1cf396e5206a6c28e68097257625c1df9.zip
Qt-3f960aa1cf396e5206a6c28e68097257625c1df9.tar.gz
Qt-3f960aa1cf396e5206a6c28e68097257625c1df9.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Prevent infinite loop in raster engine on zero dash pattern length.
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 682731a..ba618ea 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -3706,6 +3706,13 @@ void QRasterPaintEnginePrivate::rasterizeLine_dashed(QLineF line,
const bool squareCap = (pen.capStyle() == Qt::SquareCap);
const QVector<qreal> pattern = pen.dashPattern();
+ qreal patternLength = 0;
+ for (int i = 0; i < pattern.size(); ++i)
+ patternLength += pattern.at(i);
+
+ if (patternLength <= 0)
+ return;
+
qreal length = line.length();
Q_ASSERT(length > 0);
while (length > 0) {