diff --git a/java/org/brotli/wrapper/dec/decoder_jni.cc b/java/org/brotli/wrapper/dec/decoder_jni.cc index 1004bab..a92d34c 100644 --- a/java/org/brotli/wrapper/dec/decoder_jni.cc +++ b/java/org/brotli/wrapper/dec/decoder_jni.cc @@ -24,7 +24,6 @@ typedef struct DecoderHandle { size_t dictionary_count; uint8_t* input_start; - size_t input_size; size_t input_offset; size_t input_length; } DecoderHandle; @@ -68,7 +67,6 @@ JNIEXPORT jobject JNICALL Java_org_brotli_wrapper_dec_DecoderJNI_nativeCreate( handle->dictionary_count = 0; handle->input_offset = 0; handle->input_length = 0; - handle->input_size = 0; handle->input_start = nullptr; if (input_size == 0) { @@ -76,9 +74,6 @@ JNIEXPORT jobject JNICALL Java_org_brotli_wrapper_dec_DecoderJNI_nativeCreate( } else { handle->input_start = new (std::nothrow) uint8_t[input_size]; ok = !!handle->input_start; - if (ok) { - handle->input_size = input_size; - } } } @@ -130,11 +125,6 @@ JNIEXPORT void JNICALL Java_org_brotli_wrapper_dec_DecoderJNI_nativePush( env->functions->SetLongArrayRegion(env, ctx, 0, 3, context); if (input_length != 0) { - /* Reject input length that exceeds the allocated input buffer. */ - if (input_length < 0 || - static_cast(input_length) > handle->input_size) { - return; - } /* Still have unconsumed data. Workflow is broken. */ if (handle->input_offset < handle->input_length) { return;