mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +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);
|
||||
if (const EasingSegment<QPointF> *easing = getEasingSegment(adjustedFrame)) {
|
||||
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;
|
||||
|
Reference in New Issue
Block a user