From 9e84a85d64267b06197c4228e433d4e3335c3f33 Mon Sep 17 00:00:00 2001 From: Vadim Pakhnushev Date: Fri, 23 Aug 2013 14:13:38 +0400 Subject: [PATCH] 8023052: JVM crash in native layout Reviewed-by: bae, prr --- jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp index b32f2601b4d..8036a64c4be 100644 --- a/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp +++ b/jdk/src/share/native/sun/font/layout/SunLayoutEngine.cpp @@ -179,6 +179,10 @@ JNIEXPORT void JNICALL Java_sun_font_SunLayoutEngine_nativeLayout FontInstanceAdapter fia(env, font2d, strike, mat, 72, 72, (le_int32) upem, (TTLayoutTableCache *) layoutTables); LEErrorCode success = LE_NO_ERROR; LayoutEngine *engine = LayoutEngine::layoutEngineFactory(&fia, script, lang, typo_flags & TYPO_MASK, success); + if (engine == NULL) { + env->SetIntField(gvdata, gvdCountFID, -1); // flag failure + return; + } if (min < 0) min = 0; if (max < min) max = min; /* defensive coding */ // have to copy, yuck, since code does upcalls now. this will be soooo slow