commit | 4dc55ef2017ae48d724dfac30b24b1355bceac0b | [log] [tgz] |
---|---|---|
author | Dmitry Batrak <Dmitry.Batrak@jetbrains.com> | Wed May 17 13:25:37 2017 +0300 |
committer | Dmitry Batrak <Dmitry.Batrak@jetbrains.com> | Thu May 18 12:25:20 2017 +0300 |
tree | 920694f54b1b5431f6906db0083b8fcac57f5f25 | |
parent | 644f6006d7e598cd560127b2078c6e08728f181c [diff] |
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); }