From 7c4db68428bd4774c85ae15a333fecf07a7aba99 Mon Sep 17 00:00:00 2001 From: Nicholas Guriev Date: Sat, 5 Mar 2022 22:59:54 +0300 Subject: [PATCH] Touch up negative segment start and end values NaN values are also zeroed. --- src/lottie/lottiemodel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index f2c8ff35..b1161400 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -1055,8 +1055,8 @@ class Trim : public Object { private: Segment noloop(float start, float end) const { - assert(start >= 0); - assert(end >= 0); + if (!(start >= 0)) start = 0; + if (!(end >= 0)) end = 0; Segment s; s.start = std::min(start, end); s.end = std::max(start, end); @@ -1064,8 +1064,8 @@ class Trim : public Object { } Segment loop(float start, float end) const { - assert(start >= 0); - assert(end >= 0); + if (!(start >= 0)) start = 0; + if (!(end >= 0)) end = 0; Segment s; s.start = std::max(start, end); s.end = std::min(start, end);