lottie: resolve a thread sanitizer report.

Issue: https://github.com/thorvg/thorvg/issues/1874
This commit is contained in:
Hermet Park 2023-12-29 18:07:32 +09:00 committed by Hermet Park
parent 217c53e823
commit cf35ca3392

View file

@ -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.