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:
Jinny You 2025-07-24 23:57:32 +09:00
parent 9369642642
commit 89dc0c57b4

View file

@ -697,7 +697,10 @@ float LottieLayer::remap(LottieComposition* comp, float frameNo, LottieExpressio
} else {
frameNo -= startFrame;
}
return (frameNo / timeStretch);
frameNo /= timeStretch;
if (frameNo > comp->frameCnt()) return cache.frameNo;
return frameNo;
}