summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-04-14 06:23:58 +0200
committerSven Gothel <[email protected]>2023-04-14 06:23:58 +0200
commitbeb4a2d910c4534ed10dfbb9a895acb89ed54822 (patch)
treef53c5ffec53d075ba7fd92fbb7f4eb0a9275f9ed /src/jogl/classes/jogamp/graph
parent401440e5466a0d180d5d0e563ed474f4c23d839c (diff)
Graph TypecastFont: Avoid PostTable (out-of-bounds) for glyph_name when not even a Glyph was mapped to the ID
Diffstat (limited to 'src/jogl/classes/jogamp/graph')
-rw-r--r--src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java10
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;