lottie: fix access violation while updating

Fix access issue when iterating over children
in case of an empty container.

@Issue: https://github.com/thorvg/thorvg/issues/2283
This commit is contained in:
Mira Grudzinska 2024-05-15 20:16:11 +02:00 committed by Hermet Park
parent ebc37a0f12
commit 5183cf6737

View file

@ -1283,6 +1283,8 @@ static bool _buildComposition(LottieComposition* comp, LottieGroup* parent)
bool LottieBuilder::update(LottieComposition* comp, float frameNo)
{
if (comp->root->children.empty()) return false;
frameNo += comp->startFrame;
if (frameNo < comp->startFrame) frameNo = comp->startFrame;
if (frameNo >= comp->endFrame) frameNo = (comp->endFrame - 1);