aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-04-29 13:51:15 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-30 08:01:16 +0200
commita7cb4acd5077539f78afb7fd53a6ff4231b3d63f (patch)
treef4eb63574e956c27858862b7c683d6fabe0cbe14 /src/quick
parent51665a9ecaebaef2382c1e76ebedfeffacb4b3de (diff)
Don't crash if QQuickPath has less than 4 elements
When running the Qt Cinematic demo on Android, the assertion ASSERT: "i >= 0 && i < elementCount()" in painting/qpainterpath.cpp failed because of a zero default size at startup. Change-Id: I2c46c43319cf71030cf03b1f7c6cdaec782ce11a Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/util/qquickpath.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp
index fc33f8f1f8..2278fd25ba 100644
--- a/src/quick/util/qquickpath.cpp
+++ b/src/quick/util/qquickpath.cpp
@@ -1546,7 +1546,7 @@ void QQuickPathCatmullRomCurve::addToPath(QPainterPath &path, const QQuickPathDa
nextData.curves = data.curves;
next = positionForCurve(nextData, point);
} else {
- if (point == QPointF(path.elementAt(0)) && qobject_cast<QQuickPathCatmullRomCurve*>(data.curves.at(0))) {
+ if (point == QPointF(path.elementAt(0)) && qobject_cast<QQuickPathCatmullRomCurve*>(data.curves.at(0)) && path.elementCount() >= 3) {
//this is a closed path starting and ending with catmull-rom segments.
//we try to smooth the join point
next = QPointF(path.elementAt(3)); //the first catmull-rom point