From a7cb4acd5077539f78afb7fd53a6ff4231b3d63f Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 29 Apr 2013 13:51:15 +0200 Subject: [PATCH] Don't crash if QQuickPath has less than 4 elements MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/quick/util/qquickpath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index fc33f8f..2278fd2 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(data.curves.at(0))) { + if (point == QPointF(path.elementAt(0)) && qobject_cast(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 -- 2.7.4