diff options
author | Sven Gothel <[email protected]> | 2023-04-14 06:23:58 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-04-14 06:23:58 +0200 |
commit | beb4a2d910c4534ed10dfbb9a895acb89ed54822 (patch) | |
tree | f53c5ffec53d075ba7fd92fbb7f4eb0a9275f9ed | |
parent | 401440e5466a0d180d5d0e563ed474f4c23d839c (diff) |
Graph TypecastFont: Avoid PostTable (out-of-bounds) for glyph_name when not even a Glyph was mapped to the ID
-rw-r--r-- | src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java index cc0aece27..26952ce9a 100644 --- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java +++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java @@ -193,9 +193,13 @@ class TypecastFont implements Font { TypecastGlyph result = (TypecastGlyph) idToGlyph.get(glyph_id); if (null == result) { final jogamp.graph.font.typecast.ot.Glyph glyph = font.getGlyph(glyph_id); - final PostTable post = font.getPostTable(); - final String glyph_name = null != post ? post.getGlyphName(glyph_id) : ""; - + final String glyph_name; + if( null != glyph ) { + final PostTable post = font.getPostTable(); + glyph_name = null != post ? post.getGlyphName(glyph_id) : ""; + } else { + glyph_name = ""; + } final int glyph_advance; final int glyph_leftsidebearings; final AABBox glyph_bbox; |