wasm: fix loading for binary files

This patch changes load function in thorvgwasm.cpp for using size()
instead of strlen(). It fixes loading of binary files like .tvg.
This commit is contained in:
Michal Maciola 2021-08-24 14:31:26 +02:00 committed by Hermet Park
parent f2252787ee
commit ed31fc215f

View file

@ -66,9 +66,7 @@ public:
mSwCanvas->clear();
if (data.empty()) data = defaultData;
const char *cdata = data.c_str();
if (mPicture->load(cdata, strlen(cdata)) != Result::Success) {
if (mPicture->load(data.c_str(), data.size()) != Result::Success) {
/* mPicture is not handled as unique_ptr yet, so delete here */
delete(mPicture);
mPicture = nullptr;