diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-11-15 17:39:41 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-11-15 17:48:40 +0000 |
commit | 9f1372db24cec10c1b8d7d3a38310cd0ebe26100 (patch) | |
tree | 5a3ff82096749dba25b26891ec24caa0ced31d1e /platform | |
parent | 99a2242ede36783c4f8ebc712e9eb16bc05ae3f6 (diff) | |
download | mupdf-9f1372db24cec10c1b8d7d3a38310cd0ebe26100.tar.xz |
Fix android build after fz_buffer internal hiding.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/viewer/jni/mupdf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c index 236efbf2..701390a6 100644 --- a/platform/android/viewer/jni/mupdf.c +++ b/platform/android/viewer/jni/mupdf.c @@ -1483,6 +1483,8 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz) jbyteArray bArray = NULL; fz_buffer *buf = NULL; fz_output *out = NULL; + size_t len; + unsigned char *data; fz_var(sheet); fz_var(text); @@ -1527,10 +1529,11 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz) fz_drop_output(ctx, out); out = NULL; - bArray = (*env)->NewByteArray(env, buf->len); + len = fz_buffer_storage(ctx, buf, &data); + bArray = (*env)->NewByteArray(env, len); if (bArray == NULL) fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to make byteArray"); - (*env)->SetByteArrayRegion(env, bArray, 0, buf->len, (const jbyte *)buf->data); + (*env)->SetByteArrayRegion(env, bArray, 0, len, (const jbyte *)data); } fz_always(ctx) |