--- a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java Mon Aug 18 14:03:21 2014 +0100
+++ b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java Tue Aug 19 10:32:16 2014 -0700
@@ -59,7 +59,11 @@
}
missingGlyph = 0; /* standard for TrueType fonts */
ByteBuffer buffer = font.getTableBuffer(TrueTypeFont.maxpTag);
- numGlyphs = buffer.getChar(4); // offset 4 bytes in MAXP table.
+ if (buffer != null && buffer.capacity() >= 6) {
+ numGlyphs = buffer.getChar(4); // offset 4 bytes in MAXP table.
+ } else {
+ handleBadCMAP();
+ }
if (FontUtilities.isSolaris && isJAlocale && font.supportsJA()) {
needsJAremapping = true;
if (FontUtilities.isSolaris8 &&