mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
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:
2
Telegram/ThirdParty/qtlottie
vendored
2
Telegram/ThirdParty/qtlottie
vendored
Submodule Telegram/ThirdParty/qtlottie updated: 553ec1bc79...92c5c182fd
@@ -112,9 +112,14 @@ public:
|
|||||||
|
|
||||||
int adjustedFrame = qBound(m_startFrame, frame, m_endFrame);
|
int adjustedFrame = qBound(m_startFrame, frame, m_endFrame);
|
||||||
if (const EasingSegment<QPointF> *easing = getEasingSegment(adjustedFrame)) {
|
if (const EasingSegment<QPointF> *easing = getEasingSegment(adjustedFrame)) {
|
||||||
qreal progress = ((adjustedFrame - m_startFrame) * 1.0) / (m_endFrame - m_startFrame);
|
if (easing->complete) {
|
||||||
qreal easedValue = easing->easing.valueForProgress(progress);
|
qreal progress = ((adjustedFrame - m_startFrame) * 1.0) / (m_endFrame - m_startFrame);
|
||||||
m_value = m_bezierPath.pointAtPercent(easedValue);
|
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;
|
return true;
|
||||||
|
Reference in New Issue
Block a user