Author: tilman Date: Sun Jan 7 12:36:41 2024 New Revision: 1915114 URL: http://svn.apache.org/viewvc?rev=1915114&view=rev Log: PDFBOX-5721: ignore EOF if it is before just data
Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java?rev=1915114&r1=1915113&r2=1915114&view=diff ============================================================================== --- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java (original) +++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java Sun Jan 7 12:36:41 2024 @@ -70,7 +70,11 @@ public class PostScriptTable extends TTF mimMemType1 = data.readUnsignedInt(); maxMemType1 = data.readUnsignedInt(); - if (Float.compare(formatType, 1.0f) == 0) + if (data.getCurrentPosition() == data.getOriginalDataSize()) + { + LOG.warn("No PostScript name data is provided for the font {}", ttf.getName()); + } + else if (Float.compare(formatType, 1.0f) == 0) { // This TrueType font file contains exactly the 258 glyphs in the standard Macintosh TrueType. glyphNames = WGL4Names.getAllNames();