summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-12-10 11:22:45 +0100
committerGitHub <noreply@github.com>2017-12-10 11:22:45 +0100
commitd98e2801379e1d155a78d445355ebbb717f4bbe1 (patch)
tree5918efa0c92be875bfd879777ccd308fca78c8bd /platform
parenta5b3c9cae010c98ec692bc08463cde25f8f9ac67 (diff)
parent9e9db55cb82ebfda0d6761082e9c6941e3c75082 (diff)
Merge pull request #14485 from RandomShaper/fix-android-export
Fix crash on Android export
Diffstat (limited to 'platform')
-rw-r--r--platform/android/export/export.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 67e00f4952..255413bf2c 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1557,12 +1557,15 @@ public:
encode_uint32(cl.size(), &clf[0]);
for (int i = 0; i < cl.size(); i++) {
+ print_line(itos(i) + " param: " + cl[i]);
CharString txt = cl[i].utf8();
int base = clf.size();
- clf.resize(base + 4 + txt.length());
- encode_uint32(txt.length(), &clf[base]);
- copymem(&clf[base + 4], txt.ptr(), txt.length());
- print_line(itos(i) + " param: " + cl[i]);
+ int length = txt.length();
+ if (!length)
+ continue;
+ clf.resize(base + 4 + length);
+ encode_uint32(length, &clf[base]);
+ copymem(&clf[base + 4], txt.ptr(), length);
}
zip_fileinfo zipfi = get_zip_fileinfo();