src/share/classes/sun/print/PathGraphics.java

Print this page

        

@@ -1023,11 +1023,12 @@
            if (c >= CharToGlyphMapper.HI_SURROGATE_START &&
                c <= CharToGlyphMapper.LO_SURROGATE_END) {
                 continue;
             }
             glyph = font2D.charToGlyph(c);
-            if (glyph != missingGlyph && glyph < numGlyphs &&
+            if (glyph != missingGlyph &&
+                glyph >= 0 && glyph < numGlyphs &&
                 (glyphToCharMap[glyph] ==
                  CharToGlyphMapper.INVISIBLE_GLYPH_ID)) {
                 glyphToCharMap[glyph] = c;
             }
         }