7002627: JNI Critical Arrays should be released with the original (unmodified) pointer
authorbae
Thu, 23 Dec 2010 14:27:32 +0300
changeset 7752 bac6e958f08e
parent 7751 3ffe25b53aad
child 7754 12466ded7d51
7002627: JNI Critical Arrays should be released with the original (unmodified) pointer Reviewed-by: jgodinez, prr
jdk/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c
--- a/jdk/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c	Wed Dec 22 13:49:23 2010 -0800
+++ b/jdk/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c	Thu Dec 23 14:27:32 2010 +0300
@@ -119,7 +119,8 @@
                 PtrCoord(srcInfo.rasBase,
                          srcInfo.bounds.x1, srcInfo.pixelStride,
                          srcInfo.bounds.y1, srcInfo.scanStride);
-            unsigned char *pMask =
+            unsigned char *pMask, *pMaskAlloc;
+            pMask = pMaskAlloc =
                 (*env)->GetPrimitiveArrayCritical(env, maskArray, 0);
             if (pMask == NULL) {
                 J2dRlsTraceLn(J2D_TRACE_ERROR,
@@ -274,7 +275,7 @@
             bpos += width * height * sizeof(jint);
 
             (*env)->ReleasePrimitiveArrayCritical(env, maskArray,
-                                                  pMask, JNI_ABORT);
+                                                  pMaskAlloc, JNI_ABORT);
         }
         SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
     }