Skip to content

Commit

Permalink
Fix crash when path animation data is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
smohantty committed Jan 25, 2021
1 parent ad9beae commit 1cb2021
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lottie/lottiemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ struct PathData {
VPath &result)
{
result.reset();
// test for empty animation data.
if (start.mPoints.empty() || end.mPoints.empty())
{
return;
}
auto size = std::min(start.mPoints.size(), end.mPoints.size());
/* reserve exact memory requirement at once
* ptSize = size + 1(size + close)
Expand Down

0 comments on commit 1cb2021

Please sign in to comment.