Lottie/Marker: Runtime crash when parsing error
tinyjin opened this issue · comments
Jinny You commented
Marker APIs have potential crash, which use following LottieLoader functions:
uint32_t LottieLoader::markersCnt()
const char* LottieLoader::markers(uint32_t index)
bool LottieLoader::segment(const char* marker, float& begin, float& end)
So basically, after parsing the Lottie with invalid marker object. It's going to be runtime crash when those Marker APIs called.
The parser isn't affected by this error, but recently introduced APIs seem not covered.
ThorVG must not make crash even if it has parsing error.
For example
Valid marker object
{
"tm": 33,
"cm": "sectionC",
"dr": 30
}
Invalid marker object (-> crash)
{
"tm": 33,
"cm": "sectionC",
"dr": "error because it's mismatched type"
}