changeset 8000:12ac08d79c9b

8023052: JVM crash in native layout Reviewed-by: bae, prr
author vadim
date Fri, 23 Aug 2013 14:13:38 +0400
parents 0c950b2be7ab
children b5c5cff52455
files src/share/native/sun/font/layout/SunLayoutEngine.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/font/layout/SunLayoutEngine.cpp	Mon Aug 19 11:21:19 2013 -0700
+++ b/src/share/native/sun/font/layout/SunLayoutEngine.cpp	Fri Aug 23 14:13:38 2013 +0400
@@ -179,6 +179,10 @@
   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