From 9ce784751c0d70fdf1fa958041f7f31d25e4c69e Mon Sep 17 00:00:00 2001 From: Mira Grudzinska Date: Thu, 17 Oct 2024 20:17:32 +0700 Subject: [PATCH] lottie: correct the array reserved size The color input will contain at least colorStops.count * 4 elements (not including alpha). Since the alpha offset values don't have to much colorStops, estimation is used. --- src/loaders/lottie/tvgLottieParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/lottie/tvgLottieParser.cpp b/src/loaders/lottie/tvgLottieParser.cpp index ac001f01..33c282a1 100644 --- a/src/loaders/lottie/tvgLottieParser.cpp +++ b/src/loaders/lottie/tvgLottieParser.cpp @@ -254,7 +254,7 @@ void LottieParser::getValue(ColorStop& color) { if (peekType() == kArrayType) enterArray(); - if (!color.input) color.input = new Array(static_cast(context.parent)->colorStops.count); + if (!color.input) color.input = new Array(static_cast(context.parent)->colorStops.count * 6); else color.input->clear(); while (nextArrayValue()) color.input->push(getFloat());