From 2bd25967e70afa641fd039d6702d575c3974bfa6 Mon Sep 17 00:00:00 2001 From: Nikolay Pultsin Date: Mon, 11 Apr 2011 22:40:35 +0100 Subject: [PATCH] better error handling in inflate() --- jni/DeflatingDecompressor/DeflatingDecompressor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jni/DeflatingDecompressor/DeflatingDecompressor.cpp b/jni/DeflatingDecompressor/DeflatingDecompressor.cpp index 8c13c81b0..f84bf6cad 100644 --- a/jni/DeflatingDecompressor/DeflatingDecompressor.cpp +++ b/jni/DeflatingDecompressor/DeflatingDecompressor.cpp @@ -51,7 +51,7 @@ jlong Java_org_amse_ys_zip_DeflatingDecompressor_inflate(JNIEnv *env, jobject th } } if (stream == 0) { - return 0; + return -1; } jbyte* inStart = env->GetByteArrayElements(in, 0); @@ -71,5 +71,5 @@ jlong Java_org_amse_ys_zip_DeflatingDecompressor_inflate(JNIEnv *env, jobject th } return result; } - return 0; + return -2; }