lottie: fixed memory violation.

set the dirName as the current location by default.

issue: https://github.com/thorvg/thorvg/issues/2733
This commit is contained in:
Hermet Park 2024-09-14 15:23:20 +09:00
parent 7a6a89cf26
commit 68fff066fc

View file

@ -195,9 +195,8 @@ bool LottieLoader::open(const char* data, uint32_t size, const std::string& rpat
this->size = size;
this->copy = copy;
if (!rpath.empty()) {
this->dirName = strdup(rpath.c_str());
}
if (rpath.empty()) this->dirName = strdup(".");
else this->dirName = strdup(rpath.c_str());
return header();
}