mirror of https://github.com/procxx/kepka.git
QtLottie: Fix UB in last keyframe easing point.
Example: https://lottiefiles.com/427-happy-birthday The present box top was rendered below the body or not depending on the uninitialized bytes from QBezier.
This commit is contained in:
parent
f073963582
commit
2fae2278f7
|
@ -1 +1 @@
|
|||
Subproject commit 553ec1bc799f344a12e34c91720e13a469d85365
|
||||
Subproject commit 92c5c182fd6578a4f9b2036dc86791da82c2ad6f
|
|
@ -112,9 +112,14 @@ public:
|
|||
|
||||
int adjustedFrame = qBound(m_startFrame, frame, m_endFrame);
|
||||
if (const EasingSegment<QPointF> *easing = getEasingSegment(adjustedFrame)) {
|
||||
qreal progress = ((adjustedFrame - m_startFrame) * 1.0) / (m_endFrame - m_startFrame);
|
||||
qreal easedValue = easing->easing.valueForProgress(progress);
|
||||
m_value = m_bezierPath.pointAtPercent(easedValue);
|
||||
if (easing->complete) {
|
||||
qreal progress = ((adjustedFrame - m_startFrame) * 1.0) / (m_endFrame - m_startFrame);
|
||||
qreal easedValue = easing->easing.valueForProgress(progress);
|
||||
m_value = m_bezierPath.pointAtPercent(easedValue);
|
||||
} else {
|
||||
// In case of incomplete easing we should just take the final point.
|
||||
m_value = m_bezierPath.pointAtPercent(1.);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue