8034097: [parfait] JNI exception pending in jdk/src/macosx/native/sun/awt/QuartzSurfaceData.m
authorprr
Tue, 18 Mar 2014 15:49:19 -0700
changeset 23672 8e597639b984
parent 23671 e0efb704450e
child 23673 3b037f3a2be6
8034097: [parfait] JNI exception pending in jdk/src/macosx/native/sun/awt/QuartzSurfaceData.m Reviewed-by: serb, jgodinez
jdk/src/macosx/native/sun/awt/QuartzSurfaceData.m
--- a/jdk/src/macosx/native/sun/awt/QuartzSurfaceData.m	Tue Mar 18 15:48:03 2014 -0700
+++ b/jdk/src/macosx/native/sun/awt/QuartzSurfaceData.m	Tue Mar 18 15:49:19 2014 -0700
@@ -778,6 +778,10 @@
             qsdo->graphicsStateInfo.simpleStroke = NO;
             jint length = (*env)->GetArrayLength(env, dasharray);
             jfloat* jdashes = (jfloat*)(*env)->GetPrimitiveArrayCritical(env, dasharray, NULL);
+            if (jdashes == NULL) {
+                CGContextSetLineDash(cgRef, 0, NULL, 0);
+                return;
+            }
             CGFloat* dashes = (CGFloat*)malloc(sizeof(CGFloat)*length);
             if (dashes != NULL)
             {