--- old/src/share/native/sun/font/FontInstanceAdapter.cpp 2017-11-01 10:58:29.000000000 -0700 +++ new/src/share/native/sun/font/FontInstanceAdapter.cpp 2017-11-01 10:58:29.000000000 -0700 @@ -136,12 +136,18 @@ } LEGlyphID id = (LEGlyphID)env->CallIntMethod(font2D, sunFontIDs.f2dCharToGlyphMID, (jint)mappedChar); + if ((int)id < 0) { + id = 0; + } return id; } LEGlyphID FontInstanceAdapter::mapCharToGlyph(LEUnicode32 ch) const { LEGlyphID id = (LEGlyphID)env->CallIntMethod(font2D, sunFontIDs.f2dCharToGlyphMID, ch); + if ((int)id < 0) { + id = 0; + } return id; } @@ -189,8 +195,12 @@ return 1; } - return (LEGlyphID)env->CallIntMethod(font2D, sunFontIDs.charToGlyphMID, + LEGlyphID id = (LEGlyphID)env->CallIntMethod(font2D, sunFontIDs.charToGlyphMID, mappedChar); + if ((int)id < 0) { + id = 0; + } + return id; } void FontInstanceAdapter::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const