8141213: [Parfait]Potentially blocking function GetArrayLength called in JNI critical region at line 239 of jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c in function GET_ARRAYS
authorvadim
Tue, 03 Nov 2015 14:44:10 +0300
changeset 35292 8508354e76e1
parent 35291 924c479304a5
child 35293 0265d22e3dc1
8141213: [Parfait]Potentially blocking function GetArrayLength called in JNI critical region at line 239 of jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c in function GET_ARRAYS Reviewed-by: prr, serb
jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c
--- a/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Mon Oct 26 23:41:41 2015 +0300
+++ b/jdk/src/java.desktop/share/native/libjavajpeg/jpegdecoder.c	Tue Nov 03 14:44:10 2015 +0300
@@ -234,9 +234,9 @@
     }
     if (src->hOutputBuffer) {
         assert(src->outbuf.ip == 0);
+        src->outbufSize = (*env)->GetArrayLength(env, src->hOutputBuffer);
         src->outbuf.ip = (int *)(*env)->GetPrimitiveArrayCritical
             (env, src->hOutputBuffer, 0);
-        src->outbufSize = (*env)->GetArrayLength(env, src->hOutputBuffer);
         if (src->outbuf.ip == 0) {
             RELEASE_ARRAYS(env, src);
             return 0;