# HG changeset patch # User Steve Poole # 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); }