diff --git a/src/corelib/animation/qvariantanimation.cpp b/src/corelib/animation/qvariantanimation.cpp index a0f0e176b6..026db981ea 100644 --- a/src/corelib/animation/qvariantanimation.cpp +++ b/src/corelib/animation/qvariantanimation.cpp @@ -278,7 +278,9 @@ void QVariantAnimationPrivate::setCurrentValueForProgress(const qreal progress) const qreal startProgress = currentInterval.start.first; const qreal endProgress = currentInterval.end.first; - const qreal localProgress = (progress - startProgress) / (endProgress - startProgress); + const qreal localProgress = + qIsNull(progress - startProgress) ? 0.0 // avoid 0/0 below + /* else */ : (progress - startProgress) / (endProgress - startProgress); QVariant ret = q->interpolated(currentInterval.start.second, currentInterval.end.second,