diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-05 13:08:42 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-08 18:53:00 +0800 |
commit | ad3d2d60bbc2798dba917babc8a31ac669e69e49 (patch) | |
tree | cb9b6dae0f632a7b4ad54639314f57a47f226c6a | |
parent | a7f20b00995ec482b2bf93c4fc80aa2ac26a045d (diff) | |
download | mupdf-ad3d2d60bbc2798dba917babc8a31ac669e69e49.tar.xz |
JNI: Copy data back to Java arrays.
The Java arrays are the destination when reading from Buffer.
-rw-r--r-- | platform/java/mupdf_native.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c index faa08abd..2194381b 100644 --- a/platform/java/mupdf_native.c +++ b/platform/java/mupdf_native.c @@ -4578,7 +4578,7 @@ FUN(Buffer_readBytes)(JNIEnv *env, jobject self, jint jat, jobject jbs) if (!bs) { jni_throw_io(env, "cannot get bytes to read"); return -1; } memcpy(bs, &buf->data[at], len); - (*env)->ReleaseByteArrayElements(env, jbs, bs, JNI_ABORT); + (*env)->ReleaseByteArrayElements(env, jbs, bs, 0); return len; } @@ -4612,7 +4612,7 @@ FUN(Buffer_readBytesInto)(JNIEnv *env, jobject self, jint jat, jobject jbs, jint if (!bs) { jni_throw_io(env, "cannot get bytes to read"); return -1; } memcpy(&bs[off], &buf->data[at], len); - (*env)->ReleaseByteArrayElements(env, jbs, bs, JNI_ABORT); + (*env)->ReleaseByteArrayElements(env, jbs, bs, 0); return len; } |