mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
lottie: Fix crash from invalid masking method
This change is better for stability. Returns `None` if the `mode` attribute cannot be parsed. related issue: #2072
This commit is contained in:
parent
68e4d35f7b
commit
7ec7a4c08c
1 changed files with 4 additions and 1 deletions
|
@ -42,7 +42,10 @@ static char* _int2str(int num)
|
|||
|
||||
CompositeMethod LottieParser::getMaskMethod(bool inversed)
|
||||
{
|
||||
switch (getString()[0]) {
|
||||
auto mode = getString();
|
||||
if (!mode) return CompositeMethod::None;
|
||||
|
||||
switch (mode[0]) {
|
||||
case 'a': {
|
||||
if (inversed) return CompositeMethod::InvAlphaMask;
|
||||
else return CompositeMethod::AddMask;
|
||||
|
|
Loading…
Add table
Reference in a new issue