mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-26 16:16:46 +00:00
lottie: fix timeRemap frame boundary handling
Fix logic bug in LottieLayer::remap() where timeRemap calculation could exceed frame boundaries. When the calculated mapping frame goes beyond outFrame, now returns the last valid frameNo instead of potentially invalid frame values. This ensures proper frame clamping for timeRemap animations and prevents out-of-bounds frame access. issue: https://github.com/thorvg/thorvg/issues/3591
This commit is contained in:
parent
9369642642
commit
89dc0c57b4
1 changed files with 4 additions and 1 deletions
|
@ -697,7 +697,10 @@ float LottieLayer::remap(LottieComposition* comp, float frameNo, LottieExpressio
|
||||||
} else {
|
} else {
|
||||||
frameNo -= startFrame;
|
frameNo -= startFrame;
|
||||||
}
|
}
|
||||||
return (frameNo / timeStretch);
|
frameNo /= timeStretch;
|
||||||
|
|
||||||
|
if (frameNo > comp->frameCnt()) return cache.frameNo;
|
||||||
|
return frameNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue