8034095: [parfait] JNI exception pending in src/jdk/src/macosx/native/sun/awt/QuartzRenderer.m
authorprr
Tue, 18 Mar 2014 15:48:03 -0700
changeset 23671 e0efb704450e
parent 23670 51dcbdabb951
child 23672 8e597639b984
8034095: [parfait] JNI exception pending in src/jdk/src/macosx/native/sun/awt/QuartzRenderer.m Reviewed-by: serb, jgodinez
jdk/src/macosx/native/sun/awt/QuartzRenderer.m
--- a/jdk/src/macosx/native/sun/awt/QuartzRenderer.m	Tue Mar 18 23:22:45 2014 +0400
+++ b/jdk/src/macosx/native/sun/awt/QuartzRenderer.m	Tue Mar 18 15:48:03 2014 -0700
@@ -438,6 +438,9 @@
 {
     SDRenderType renderType = SD_Nothing;
 
+    if (xpointsarray == NULL || ypointsarray == NULL) {
+        return SD_Nothing;
+    }
     if (npoints > 1)
     {
         if (fill == YES)
@@ -452,7 +455,14 @@
         jint i;
 
         jint* xpoints = (jint*)(*env)->GetPrimitiveArrayCritical(env, xpointsarray, NULL);
+        if (xpoints == NULL) {
+            return SD_Nothing;
+        }
         jint* ypoints = (jint*)(*env)->GetPrimitiveArrayCritical(env, ypointsarray, NULL);
+        if (ypoints == NULL) {
+            (*env)->ReleasePrimitiveArrayCritical(env, xpointsarray, xpoints, 0);
+            return SD_Nothing;
+        }
 
         CGContextMoveToPoint(cgRef, xpoints[0]+offsetX, ypoints[0]+offsetY);