From b63ce68f316c91b0a3107d3d20e160628f5cefef Mon Sep 17 00:00:00 2001 From: Charles Yin Date: Thu, 22 Mar 2012 14:07:28 +1000 Subject: Fix crash issue for path animation and path interpulator When set progress value out of [0,1], path animation and path interpulator should make sure the value be modified in the valid value range, otherwise the QQuickPath::backwardsPointAt() will crash. Task-number: QTBUG-24308 Change-Id: Icd6e9165c9f844ddb8ec84c229eac4db5246a749 Reviewed-by: Michael Brasser --- src/quick/util/qquickpath.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quick/util/qquickpath.cpp') diff --git a/src/quick/util/qquickpath.cpp b/src/quick/util/qquickpath.cpp index adf4242cdc..8dadab620a 100644 --- a/src/quick/util/qquickpath.cpp +++ b/src/quick/util/qquickpath.cpp @@ -527,6 +527,8 @@ QPointF QQuickPath::sequentialPointAt(qreal p, qreal *angle) const QPointF QQuickPath::sequentialPointAt(const QPainterPath &path, const qreal &pathLength, const QList &attributePoints, QQuickCachedBezier &prevBez, qreal p, qreal *angle) { + Q_ASSERT(p >= 0.0 && p <= 1.0); + if (!prevBez.isValid) return p > .5 ? backwardsPointAt(path, pathLength, attributePoints, prevBez, p, angle) : forwardsPointAt(path, pathLength, attributePoints, prevBez, p, angle); -- cgit v1.2.3