< prev index next >

src/java.desktop/share/native/libfontmanager/HBShaper.c

Print this page

        

*** 276,285 **** --- 276,291 ---- direction = HB_DIRECTION_RTL; } hb_buffer_set_direction(buffer, direction); chars = (*env)->GetCharArrayElements(env, text, NULL); + if ((*env)->ExceptionCheck(env)) { + hb_buffer_destroy(buffer); + hb_font_destroy(hbfont); + free((void*)jdkFontInfo); + return JNI_FALSE; + } len = (*env)->GetArrayLength(env, text); hb_buffer_add_utf16(buffer, chars, len, offset, limit-offset); hb_shape_full(hbfont, buffer, features, featureCount, 0);
*** 307,315 **** --- 313,322 ---- hb_buffer_destroy (buffer); hb_font_destroy(hbfont); free((void*)jdkFontInfo); if (features != NULL) free(features); + (*env)->ReleaseCharArrayElements(env, text, chars, JNI_ABORT); return JNI_TRUE; }
< prev index next >