mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
lottie: fixed a invalid memory access
looping doesn't make sense if the animation doesn't have frames. use the current frame number.
This commit is contained in:
parent
3fbc36629f
commit
fa0a1b7e60
1 changed files with 1 additions and 0 deletions
|
@ -286,6 +286,7 @@ float _frameNo(T* frames, int32_t key)
|
|||
template<typename T>
|
||||
float _loop(T* frames, float frameNo, LottieExpression* exp)
|
||||
{
|
||||
if (!frames) return frameNo;
|
||||
if (exp->loop.mode == LottieExpression::LoopMode::None) return frameNo;
|
||||
|
||||
if (frameNo >= exp->loop.in || frameNo < frames->first().no || frameNo < frames->last().no) return frameNo;
|
||||
|
|
Loading…
Add table
Reference in a new issue