mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +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
1b37743b2c
commit
e1beceba80
1 changed files with 1 additions and 0 deletions
|
@ -251,6 +251,7 @@ float _frameNo(T* frames, int32_t key)
|
||||||
template<typename T>
|
template<typename T>
|
||||||
float _loop(T* frames, float frameNo, LottieExpression* exp)
|
float _loop(T* frames, float frameNo, LottieExpression* exp)
|
||||||
{
|
{
|
||||||
|
if (!frames) return frameNo;
|
||||||
if (frameNo >= exp->loop.in || frameNo < frames->first().no || frameNo < frames->last().no) return frameNo;
|
if (frameNo >= exp->loop.in || frameNo < frames->first().no || frameNo < frames->last().no) return frameNo;
|
||||||
|
|
||||||
frameNo -= frames->first().no;
|
frameNo -= frames->first().no;
|
||||||
|
|
Loading…
Add table
Reference in a new issue