src/macosx/native/sun/awt/QuartzRenderer.m

Print this page

        

*** 436,445 **** --- 436,448 ---- QUARTZ_RENDERER_INLINE SDRenderType doPolyUsingCG(JNIEnv *env, CGContextRef cgRef, jintArray xpointsarray, jintArray ypointsarray, jint npoints, BOOL polygon, BOOL fill, CGFloat offsetX, CGFloat offsetY) { SDRenderType renderType = SD_Nothing; + if (xpointsarray == NULL || ypointsarray == NULL) { + return SD_Nothing; + } if (npoints > 1) { if (fill == YES) { renderType = SD_Fill;
*** 450,460 **** --- 453,470 ---- } 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); for (i=1; i<npoints; i++) {