From 07229aa2f788229ab4f50379308297f428e3d2d2 Mon Sep 17 00:00:00 2001 From: Xiaoguang Sun Date: Sat, 16 Aug 2014 18:55:04 +0800 Subject: [PATCH] Fix incorrect ReleasePrimitiveArrayCritical call --- src/jni/net_jpountz_lz4_LZ4JNI.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/jni/net_jpountz_lz4_LZ4JNI.c b/src/jni/net_jpountz_lz4_LZ4JNI.c index 0061255d..8217ed17 100644 --- a/src/jni/net_jpountz_lz4_LZ4JNI.c +++ b/src/jni/net_jpountz_lz4_LZ4JNI.c @@ -57,7 +57,7 @@ JNIEXPORT jint JNICALL Java_net_jpountz_lz4_LZ4JNI_LZ4_1compress_1limitedOutput compressed = LZ4_compress_limitedOutput(in + srcOff, out + destOff, srcLen, maxDestLen); (*env)->ReleasePrimitiveArrayCritical(env, src, in, 0); - (*env)->ReleasePrimitiveArrayCritical(env, src, out, 0); + (*env)->ReleasePrimitiveArrayCritical(env, dest, out, 0); return compressed; @@ -89,7 +89,7 @@ JNIEXPORT jint JNICALL Java_net_jpountz_lz4_LZ4JNI_LZ4_1compressHC compressed = LZ4_compressHC_limitedOutput(in + srcOff, out + destOff, srcLen, maxDestLen); (*env)->ReleasePrimitiveArrayCritical(env, src, in, 0); - (*env)->ReleasePrimitiveArrayCritical(env, src, out, 0); + (*env)->ReleasePrimitiveArrayCritical(env, dest, out, 0); return compressed; @@ -121,7 +121,7 @@ JNIEXPORT jint JNICALL Java_net_jpountz_lz4_LZ4JNI_LZ4_1decompress_1fast compressed = LZ4_decompress_fast(in + srcOff, out + destOff, destLen); (*env)->ReleasePrimitiveArrayCritical(env, src, in, 0); - (*env)->ReleasePrimitiveArrayCritical(env, src, out, 0); + (*env)->ReleasePrimitiveArrayCritical(env, dest, out, 0); return compressed; @@ -153,7 +153,7 @@ JNIEXPORT jint JNICALL Java_net_jpountz_lz4_LZ4JNI_LZ4_1decompress_1safe decompressed = LZ4_decompress_safe(in + srcOff, out + destOff, srcLen, maxDestLen); (*env)->ReleasePrimitiveArrayCritical(env, src, in, 0); - (*env)->ReleasePrimitiveArrayCritical(env, src, out, 0); + (*env)->ReleasePrimitiveArrayCritical(env, dest, out, 0); return decompressed; @@ -185,7 +185,7 @@ JNIEXPORT jint JNICALL Java_net_jpountz_lz4_LZ4JNI_LZ4_1decompress_1fast_1withPr compressed = LZ4_decompress_fast_withPrefix64k(in + srcOff, out + destOff, destLen); (*env)->ReleasePrimitiveArrayCritical(env, src, in, 0); - (*env)->ReleasePrimitiveArrayCritical(env, src, out, 0); + (*env)->ReleasePrimitiveArrayCritical(env, dest, out, 0); return compressed; @@ -217,7 +217,7 @@ JNIEXPORT jint JNICALL Java_net_jpountz_lz4_LZ4JNI_LZ4_1decompress_1safe_1withPr decompressed = LZ4_decompress_safe_withPrefix64k(in + srcOff, out + destOff, srcLen, maxDestLen); (*env)->ReleasePrimitiveArrayCritical(env, src, in, 0); - (*env)->ReleasePrimitiveArrayCritical(env, src, out, 0); + (*env)->ReleasePrimitiveArrayCritical(env, dest, out, 0); return decompressed;