mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-28 17:15:57 +00:00
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:
parent
f2252787ee
commit
ed31fc215f
1 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue