mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 14:13:43 +00:00
lottie: resolve a thread sanitizer report.
Issue: https://github.com/thorvg/thorvg/issues/1874
This commit is contained in:
parent
217c53e823
commit
cf35ca3392
1 changed files with 9 additions and 6 deletions
|
@ -60,10 +60,6 @@ void LottieLoader::run(unsigned tid)
|
||||||
comp = parser.comp;
|
comp = parser.comp;
|
||||||
}
|
}
|
||||||
builder->build(comp);
|
builder->build(comp);
|
||||||
w = static_cast<float>(comp->w);
|
|
||||||
h = static_cast<float>(comp->h);
|
|
||||||
frameDuration = comp->duration();
|
|
||||||
frameCnt = comp->frameCnt();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,8 +92,15 @@ bool LottieLoader::header()
|
||||||
//A single thread doesn't need to perform intensive tasks.
|
//A single thread doesn't need to perform intensive tasks.
|
||||||
if (TaskScheduler::threads() == 0) {
|
if (TaskScheduler::threads() == 0) {
|
||||||
run(0);
|
run(0);
|
||||||
if (comp) return true;
|
if (comp) {
|
||||||
else return false;
|
w = static_cast<float>(comp->w);
|
||||||
|
h = static_cast<float>(comp->h);
|
||||||
|
frameDuration = comp->duration();
|
||||||
|
frameCnt = comp->frameCnt();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Quickly validate the given Lottie file without parsing in order to get the animation info.
|
//Quickly validate the given Lottie file without parsing in order to get the animation info.
|
||||||
|
|
Loading…
Add table
Reference in a new issue