Fix crash when path animation data is empty
authorSubhransu Mohanty <sub.mohanty@samsung.com>
Mon, 25 Jan 2021 01:47:25 +0000 (10:47 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 15 Mar 2021 06:04:14 +0000 (15:04 +0900)
Change-Id: I31c61d053af4dafbf536e5e214cbee4885c26647

src/lottie/lottiemodel.h

index 7f95c7fc376e570db51163a9ad0c02b704015b2b..977e808ba4683b920cdf0802f3948a5819a95ed6 100644 (file)
@@ -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)