From 892dfaa2e165a950bab853de2ae62a6bac3732b4 Mon Sep 17 00:00:00 2001 From: Subhransu Mohanty Date: Mon, 25 Jan 2021 10:47:25 +0900 Subject: [PATCH] Fix crash when path animation data is empty Change-Id: I31c61d053af4dafbf536e5e214cbee4885c26647 --- src/lottie/lottiemodel.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index 7f95c7f..977e808 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -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) -- 2.34.1