src/share/native/sun/java2d/pipe/BufferedMaskBlit.c

Print this page

        

@@ -117,11 +117,12 @@
             jint srcPixelStride = srcInfo.pixelStride;
             jint *pSrc = (jint *)
                 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,
                     "BufferedMaskBlit_enqueueTile: cannot lock mask array");
                 SurfaceData_InvokeRelease(env, srcOps, &srcInfo);

@@ -272,11 +273,11 @@
 
             // increment current byte position
             bpos += width * height * sizeof(jint);
 
             (*env)->ReleasePrimitiveArrayCritical(env, maskArray,
-                                                  pMask, JNI_ABORT);
+                                                  pMaskAlloc, JNI_ABORT);
         }
         SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
     }
     SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);