loader/lottie: fix a invalid matte source access.

parser ignored a matte source has no target.
this fixes the corner case.
This commit is contained in:
Hermet Park 2023-09-11 21:55:36 +09:00
parent 78b14aecb4
commit 1bcbac71ab

View file

@ -1074,8 +1074,13 @@ LottieLayer* LottieParser::parseLayers()
root->children.push(layer);
} else {
//matte source must be located in the right previous.
layer->matte.target = static_cast<LottieLayer*>(root->children.last());
layer->statical &= layer->matte.target->statical;
auto matte = static_cast<LottieLayer*>(root->children.last());
if (matte->matteSrc) {
layer->matte.target = matte;
layer->statical &= layer->matte.target->statical;
} else {
TVGLOG("LOTTIE", "Matte Source(%s) is not designated?", matte->name);
}
root->children.last() = layer;
}
root->statical &= layer->statical;