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

Got ArrayIndexOutOfBoundsException in parsing a Chinese ttf file.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.8.4, 2.0.0
    • Component/s: FontBox
    • Labels:
      None

      Description

      using this code to parse the ttf file:
      public static void main(String[] args) throws IOException

      { TTFParser parser = new TTFParser(); TrueTypeFont font = parser.parseTTF("C:\\workspace\\downloader\\pdf\\金梅毛行书.TTF"); System.out.println("Font:" + font); }

      got exception with stacktrace:
      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 41280
      at org.apache.fontbox.ttf.CMAPEncodingEntry.processSubtype2(CMAPEncodingEntry.java:429)
      at org.apache.fontbox.ttf.CMAPEncodingEntry.initSubtable(CMAPEncodingEntry.java:82)
      at org.apache.fontbox.ttf.CMAPTable.initData(CMAPTable.java:90)
      at org.apache.fontbox.ttf.AbstractTTFParser.parseTables(AbstractTTFParser.java:163)
      at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:61)
      at org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java:90)
      at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:26)
      at org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java:43)
      at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:26)
      at elmar.demo.TFFTest.main(TFFTest.java:11)

        Attachments

        1. 金梅毛行书.TTF
          3.64 MB
          Elmar Chen

          Issue Links

            Activity

              People

              • Assignee:
                lehmi Andreas Lehmkühler
                Reporter:
                elmar Elmar Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: