Skip to content

Conversation

@john-preston
Copy link
Contributor

In case of bad input file there could be a cycle in parent-child relationship that leads to stack overflow crash. Simplest case is when the layer is made a parent to itself.

@smohantty
Copy link
Contributor

@john-preston ,
I tried to reproduce your use case in After Effect. But After effect prevents assigning self assignment as well as cyclic parent . I understand maybe user can edit the json file and change the parent id. but then that is applicable to every property inside json file .

I think this fix should go inside the Model so that rendering code will be much simpler to maintain. as less unusual case to handle.

@john-preston
Copy link
Contributor Author

Yes, the idea is to handle without crashing any json file the user offers.

I didn't understand where you think the checks for the cycles should go inside the Model and when should they be performed.

@smohantty
Copy link
Contributor

What I meant is .. this checks should go inside lottieparser so that the renderer dosen't have to deal with all the checks to see if the layer is valid or not. If during resource parsing we find the layer data is corrupted then we can just remove that layer all together.
I have added a patch which checks for assigning parent to itself . you can add the patch to check for
cycle in layer parent tree after parsing the Layers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants