I'm adding the patch attached to the original message on the awt-dev@ list.

--
best regards,
Anthony

On 12/20/2010 3:57 PM, Anthony Petrov wrote:
Hi Steve,

This is a 2D issue, and as such I'm CC'ing 2d-dev@ and BCC'ing awt-...@.

--
best regards,
Anthony

On 12/20/2010 11:04 AM, Steve Poole wrote:

Hi all - please find attached a patch for your consideration. I've build
and tested the change on Linux and Solaris at head (which is to say I've
run the automatic jtreg tests ) and the change doesn't seem to have
broken
anything. Its fairly trivial anyway.


Regards

Steve Poole

(See attached file: 7002627.export)
# HG changeset patch
# User Steve Poole <[email protected]>
# Date 1292588215 0
# Node ID c70d3958f6ec5c8b00ebec21da780e76d688a8b8
# Parent  ac311eb325bfc763698219252bf3cee9e091f3af
7002627 : JNI Critical Arrays should be released with the original (unmodified) 
pointer

diff --git a/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c 
b/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c
--- a/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c
+++ b/src/share/native/sun/java2d/pipe/BufferedMaskBlit.c
@@ -119,9 +119,9 @@
                 PtrCoord(srcInfo.rasBase,
                          srcInfo.bounds.x1, srcInfo.pixelStride,
                          srcInfo.bounds.y1, srcInfo.scanStride);
-            unsigned char *pMask =
+            unsigned char *pMaskAlloc =
                 (*env)->GetPrimitiveArrayCritical(env, maskArray, 0);
-            if (pMask == NULL) {
+            if (pMaskAlloc == NULL) {
                 J2dRlsTraceLn(J2D_TRACE_ERROR,
                     "BufferedMaskBlit_enqueueTile: cannot lock mask array");
                 SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
@@ -129,6 +129,10 @@
                 return bpos;
             }
 
+            // create data cursor for reading from mask array
+
+            unsigned char *pMask =pMaskAlloc;
+
             width = srcInfo.bounds.x2 - srcInfo.bounds.x1;
             height = srcInfo.bounds.y2 - srcInfo.bounds.y1;
             maskoff += ((srcInfo.bounds.y1 - srcy) * maskscan +
@@ -274,7 +278,7 @@
             bpos += width * height * sizeof(jint);
 
             (*env)->ReleasePrimitiveArrayCritical(env, maskArray,
-                                                  pMask, JNI_ABORT);
+                                                  pMaskAlloc, JNI_ABORT);
         }
         SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
     }

Reply via email to