refix EA-81762 (AIOOBE at CompositeStrike.getStrikeForSlot) by backporting fix for JDK-8172967 from JDK9
diff --git a/src/share/classes/sun/font/CompositeStrike.java b/src/share/classes/sun/font/CompositeStrike.java
index 7d3685f..be6092f 100644
--- a/src/share/classes/sun/font/CompositeStrike.java
+++ b/src/share/classes/sun/font/CompositeStrike.java
@@ -71,7 +71,9 @@
     }
 
     PhysicalStrike getStrikeForSlot(int slot) {
-
+        if (slot >= strikes.length) {
+            slot = 0;
+        }
         PhysicalStrike strike = strikes[slot];
         if (strike == null) {
             strike =
diff --git a/src/share/classes/sun/font/ExtendedTextSourceLabel.java b/src/share/classes/sun/font/ExtendedTextSourceLabel.java
index 9dbdff4..fd74690 100644
--- a/src/share/classes/sun/font/ExtendedTextSourceLabel.java
+++ b/src/share/classes/sun/font/ExtendedTextSourceLabel.java
@@ -626,7 +626,11 @@
         glyphinfo = gv.getGlyphInfo();
     }
     catch (Exception e) {
-        System.out.println(source);
+        if (DEBUG) {
+            System.err.println(source);
+            e.printStackTrace();
+        }
+        glyphinfo = new float[gv.getNumGlyphs() * numvals];
     }
 
     int numGlyphs = gv.getNumGlyphs();
diff --git a/src/share/native/sun/font/hb-jdk-font.cpp b/src/share/native/sun/font/hb-jdk-font.cpp
index 5224bfd..3bf58b2 100644
--- a/src/share/native/sun/font/hb-jdk-font.cpp
+++ b/src/share/native/sun/font/hb-jdk-font.cpp
@@ -54,6 +54,9 @@
 
     *glyph = (hb_codepoint_t)
           env->CallIntMethod(font2D, sunFontIDs.f2dCharToGlyphMID, u);
+    if ((int)*glyph < 0) {
+        *glyph = 0;
+    }
     return (*glyph != 0);
 }