diff --git a/src/loaders/lottie/tvgLottieModel.h b/src/loaders/lottie/tvgLottieModel.h index 0991bbb6..d8d6dd4a 100644 --- a/src/loaders/lottie/tvgLottieModel.h +++ b/src/loaders/lottie/tvgLottieModel.h @@ -57,7 +57,9 @@ struct LottieStroke if (dashattr->size + 1 > dashattr->allocated) { dashattr->allocated = dashattr->size + 2; auto newValues = new LottieFloat[dashattr->allocated]; - for (uint8_t i = 0; i < dashattr->size; ++i) newValues[i] = LottieFloat(dashattr->values[i]); + for (uint8_t i = 0; i < dashattr->size; ++i) { + newValues[i].copy(dashattr->values[i]); + } delete[] dashattr->values; dashattr->values = newValues; } diff --git a/src/loaders/lottie/tvgLottieProperty.h b/src/loaders/lottie/tvgLottieProperty.h index 07abff4f..6e4f94cd 100644 --- a/src/loaders/lottie/tvgLottieProperty.h +++ b/src/loaders/lottie/tvgLottieProperty.h @@ -163,6 +163,9 @@ struct LottieProperty bool copy(LottieProperty* rhs, bool shallow) { + type = rhs->type; + ix = rhs->ix; + if (!rhs->exp) return false; if (shallow) { exp = rhs->exp; @@ -290,8 +293,6 @@ struct LottieGenericProperty : LottieProperty LottieGenericProperty(const LottieGenericProperty& rhs) { copy(const_cast&>(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieGenericProperty() @@ -548,8 +549,6 @@ struct LottieColorStop : LottieProperty LottieColorStop(const LottieColorStop& rhs) { copy(const_cast(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieColorStop() @@ -807,8 +806,6 @@ struct LottieTextDoc : LottieProperty LottieTextDoc(const LottieTextDoc& rhs) { copy(const_cast(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieTextDoc() @@ -923,8 +920,6 @@ struct LottieBitmap : LottieProperty LottieBitmap(const LottieBitmap& rhs) { copy(const_cast(rhs)); - type = rhs.type; - ix = rhs.ix; } ~LottieBitmap()