OpenJDK / jdk / jdk
changeset 23696:7deff68428ef
8034113: [parfait] JNI exception pending in jdk/src/macosx/native/sun/font/AWTStrike.m
Reviewed-by: jgodinez, serb
author | prr |
---|---|
date | Fri, 21 Mar 2014 11:33:52 -0700 |
parents | 3eb0829f4e08 |
children | e556a715949f |
files | jdk/src/macosx/native/sun/font/AWTStrike.m |
diffstat | 1 files changed, 17 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/jdk/src/macosx/native/sun/font/AWTStrike.m Fri Mar 21 11:32:23 2014 -0700 +++ b/jdk/src/macosx/native/sun/font/AWTStrike.m Fri Mar 21 11:33:52 2014 -0700 @@ -127,6 +127,9 @@ } jdouble *txPtr = (*env)->GetPrimitiveArrayCritical(env, txArray, NULL); + if (txPtr == NULL) { + return CGAffineTransformIdentity; + } CGAffineTransform tx = CGAffineTransformMake(txPtr[0], txPtr[1], txPtr[2], @@ -311,18 +314,22 @@ jlong *glyphInfos = (*env)->GetPrimitiveArrayCritical(env, glyphInfoLongArray, NULL); - jint *rawGlyphCodes = - (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL); + if (glyphInfos != NULL) { + jint *rawGlyphCodes = + (*env)->GetPrimitiveArrayCritical(env, glyphCodes, NULL); - CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike, - rawGlyphCodes, len); + if (rawGlyphCodes != NULL) { + CGGlyphImages_GetGlyphImagePtrs(glyphInfos, awtStrike, + rawGlyphCodes, len); - (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes, - rawGlyphCodes, JNI_ABORT); - // Do not use JNI_COMMIT, as that will not free the buffer copy - // when +ProtectJavaHeap is on. - (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray, - glyphInfos, 0); + (*env)->ReleasePrimitiveArrayCritical(env, glyphCodes, + rawGlyphCodes, JNI_ABORT); + } + // Do not use JNI_COMMIT, as that will not free the buffer copy + // when +ProtectJavaHeap is on. + (*env)->ReleasePrimitiveArrayCritical(env, glyphInfoLongArray, + glyphInfos, 0); + } JNF_COCOA_EXIT(env); }