diff options
author | Sven Göthel <[email protected]> | 2024-02-03 05:05:40 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-02-03 05:05:40 +0100 |
commit | 108ce31a624587ac271f88c7ac433d92ee936d9b (patch) | |
tree | c7e2247c645faca0b258b22dd09589623ceff7f7 /src | |
parent | 7af6f502057a2932aa4a5e3adf2b260fc65a1aac (diff) |
Re-apply overwritten stability changes (NPE, redundancy)jogl_patches
JOGL/JogAmp from
- 0e5e38478a6197b2dc65960c55bc831d6b4796a7 Sun Feb 12 00:54:40 2023 +0100
- d18df847b17a89fdc4b47fa9cfe010af1a61690b Sat Mar 1 16:48:48 2014 +0100
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/java/dev/typecast/ot/table/GlyfCompositeDescript.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/main/java/net/java/dev/typecast/ot/table/GlyfCompositeDescript.java b/src/main/java/net/java/dev/typecast/ot/table/GlyfCompositeDescript.java index 4adcca5..8ff6fc5 100644 --- a/src/main/java/net/java/dev/typecast/ot/table/GlyfCompositeDescript.java +++ b/src/main/java/net/java/dev/typecast/ot/table/GlyfCompositeDescript.java @@ -176,7 +176,8 @@ public class GlyfCompositeDescript extends GlyfDescript { @Override public int getContourCount() { final GlyfCompositeComp last = lastComponent(); - return last.getFirstContour() + getReferencedGlyph(last).getContourCount(); + final GlyfDescript lastD = getReferencedGlyph(last); + return last.getFirstContour() + ( null != lastD ? lastD.getContourCount() : 0 ); } private GlyfCompositeComp lastComponent() { @@ -206,24 +207,24 @@ public class GlyfCompositeDescript extends GlyfDescript { } private GlyfCompositeComp getCompositeComp(final int i) { - GlyfCompositeComp c; - for (final GlyfCompositeComp component : _components) { - c = component; + for (final GlyfCompositeComp c : _components) { final GlyphDescription gd = getReferencedGlyph(c); - if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount())) { - return c; + if( null != gd ) { + if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount())) { + return c; + } } } return null; } private GlyfCompositeComp getCompositeCompEndPt(final int i) { - GlyfCompositeComp c; - for (final GlyfCompositeComp component : _components) { - c = component; + for (final GlyfCompositeComp c : _components) { final GlyphDescription gd = getReferencedGlyph(c); - if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount())) { - return c; + if( null != gd ) { + if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount())) { + return c; + } } } return null; |