mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
lottie: fix mem leak
Mem leak was observed in a case the end values (deprecated feature) were provided for the gradient. @Issue: https://github.com/thorvg/thorvg/issues/2667
This commit is contained in:
parent
fa9223fe1e
commit
80a977f07e
1 changed files with 2 additions and 1 deletions
|
@ -254,7 +254,8 @@ void LottieParser::getValue(ColorStop& color)
|
|||
{
|
||||
if (peekType() == kArrayType) enterArray();
|
||||
|
||||
color.input = new Array<float>(static_cast<LottieGradient*>(context.parent)->colorStops.count);
|
||||
if (!color.input) color.input = new Array<float>(static_cast<LottieGradient*>(context.parent)->colorStops.count);
|
||||
else color.input->clear();
|
||||
|
||||
while (nextArrayValue()) color.input->push(getFloat());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue