mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-28 09:05:52 +00:00
lottie/slot: Fix slot resetting bug
When resetting back to animated property, system causes an UAF because frames have been freed. Mark frames in nullptr at the case, so it doesn't use frame data after freed. Issue: #2255
This commit is contained in:
parent
6235068cad
commit
83eb8ba37b
1 changed files with 3 additions and 0 deletions
|
@ -712,16 +712,19 @@ struct LottieSlot
|
|||
case LottieProperty::Type::ColorStop: {
|
||||
static_cast<LottieGradient*>(pair->obj)->colorStops.release();
|
||||
static_cast<LottieGradient*>(pair->obj)->colorStops = *static_cast<LottieColorStop*>(pair->prop);
|
||||
static_cast<LottieColorStop*>(pair->prop)->frames = nullptr;
|
||||
break;
|
||||
}
|
||||
case LottieProperty::Type::Color: {
|
||||
static_cast<LottieSolid*>(pair->obj)->color.release();
|
||||
static_cast<LottieSolid*>(pair->obj)->color = *static_cast<LottieColor*>(pair->prop);
|
||||
static_cast<LottieColor*>(pair->prop)->frames = nullptr;
|
||||
break;
|
||||
}
|
||||
case LottieProperty::Type::TextDoc: {
|
||||
static_cast<LottieText*>(pair->obj)->doc.release();
|
||||
static_cast<LottieText*>(pair->obj)->doc = *static_cast<LottieTextDoc*>(pair->prop);
|
||||
static_cast<LottieTextDoc*>(pair->prop)->frames = nullptr;
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
|
|
Loading…
Add table
Reference in a new issue