Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5744

EOFException while readMultipleSubstitutionSubtable()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.2 PDFBox
    • 3.0.2 PDFBox, 4.0.0
    • FontBox

    Description

      Another found because of PDFBOX-5743.

      TrueTypeCollection ttc = new TrueTypeCollection(new File("NotoSerifMyanmar.ttc"));
      ttc.processAllFonts((TrueTypeFont ttf) ->
      {
          System.out.println(ttf.getName());
      });
      
      
      

      java.io.EOFException: EOF
      at org.apache.fontbox.ttf.TTFDataStream.readUnsignedShort(TTFDataStream.java:154)
      at org.apache.fontbox.ttf.TTFDataStream.readUnsignedShortArray(TTFDataStream.java:188)
      at org.apache.fontbox.ttf.GlyphSubstitutionTable.readMultipleSubstitutionSubtable(GlyphSubstitutionTable.java:561)
      at org.apache.fontbox.ttf.GlyphSubstitutionTable.readLookupSubtable(GlyphSubstitutionTable.java:284)
      at org.apache.fontbox.ttf.GlyphSubstitutionTable.readLookupTable(GlyphSubstitutionTable.java:451)
      at org.apache.fontbox.ttf.GlyphSubstitutionTable.readLookupList(GlyphSubstitutionTable.java:268)

      
      

      Assuming that such font files are correct, the investigation showed that the table is read several times, i.e. the glyphCount variable was used wrongly.

      Attachments

        1. NotoSerifMyanmar.ttc
          1.10 MB
          Tilman Hausherr

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              tilman Tilman Hausherr
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: