ICEpdf
  1. ICEpdf
  2. PDF-442

ArrayIndexOutOfBoundsException thrown from org.icepdf.core.pobjects.fonts.nfont.g.readStringPascal

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.2
    • Fix Version/s: 4.3.3
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All

      Description

      When trying to render a PDF the following exception is thrown:

      FINE: Error initializing Page.
      java.lang.ArrayIndexOutOfBoundsException: 585
      at org.icepdf.core.pobjects.fonts.nfont.g.readStringPascal(Unknown Source)
      at org.icepdf.core.pobjects.fonts.nfont.NFontTrueType.readPostTable(Unknown Source)
      at org.icepdf.core.pobjects.fonts.nfont.NFontTrueType.deriveFont(Unknown Source)
      at org.icepdf.core.pobjects.fonts.nfont.Font.setEncoding(Unknown Source)
      at org.icepdf.core.pobjects.fonts.nfont.Font.init(Unknown Source)
      at org.icepdf.core.pobjects.Resources.getFont(Resources.java:222)
      at org.icepdf.core.util.ContentParser.consume_Tf(ContentParser.java:2089)
      at org.icepdf.core.util.ContentParser.parseText(ContentParser.java:1074)
      at org.icepdf.core.util.ContentParser.parse(ContentParser.java:259)
      at org.icepdf.core.pobjects.Page.init(Page.java:372)
      at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1072)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)

        Activity

        Hide
        Patrick Corless added a comment -

        When parsing out the TrueType font's post table the parser is running out of bytes. Pretty sure there is an extra byte that is tricking the parser into thinking there is another set of names to read. I added some length checks and the method will now return null names if it gets into trouble. This is the only case we have of such a problem so my best guess this is a quirk with the wPDF producer that was used for this file and or the font itself.

        Show
        Patrick Corless added a comment - When parsing out the TrueType font's post table the parser is running out of bytes. Pretty sure there is an extra byte that is tricking the parser into thinking there is another set of names to read. I added some length checks and the method will now return null names if it gets into trouble. This is the only case we have of such a problem so my best guess this is a quirk with the wPDF producer that was used for this file and or the font itself.
        Hide
        Patrick Corless added a comment -

        Checked in fix. Closing issue.

        Show
        Patrick Corless added a comment - Checked in fix. Closing issue.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: