diff --git a/jdhuff.c b/jdhuff.c index c2b38a9e..f822dba8 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -758,7 +758,7 @@ decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) usefast = 0; } - if (cinfo->src->bytes_in_buffer < BUFSIZE * cinfo->blocks_in_MCU + if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU || cinfo->unread_marker != 0) usefast = 0; diff --git a/turbojpeg-jni.c b/turbojpeg-jni.c index 25cca7db..1ff9bbaf 100644 --- a/turbojpeg-jni.c +++ b/turbojpeg-jni.c @@ -635,7 +635,8 @@ JNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transf if(t[i].r.w!=0) w=t[i].r.w; if(t[i].r.h!=0) h=t[i].r.h; bailif0(jdstBufs[i]=(*env)->GetObjectArrayElement(env, dstobjs, i)); - if((*env)->GetArrayLength(env, jdstBufs[i])GetArrayLength(env, jdstBufs[i]) + GetPrimitiveArrayCritical(env, jdstBufs[i], 0)); } diff --git a/turbojpeg.c b/turbojpeg.c index e27f0da0..2d5959a3 100644 --- a/turbojpeg.c +++ b/turbojpeg.c @@ -1065,7 +1065,7 @@ DLLEXPORT int DLLCALL tjTransform(tjhandle handle, unsigned char *jpegBuf, &xinfo[i]); if(t[i].customFilter) { - int ci, by, y; + int ci, y; JDIMENSION by; for(ci=0; cinum_components; ci++) { jpeg_component_info *compptr=&cinfo->comp_info[ci];