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

IllegalArgumentException in PDFObjectStreamParser.privateReadObjectNumbers

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.22, 3.0.0 PDFBox
    • Fix Version/s: 2.0.23, 3.0.0 PDFBox
    • Component/s: Parsing
    • Labels:
      None

      Description

      The attached (broken) PDF throws the following undeclared exception when loaded via Loader.loadPDF (using current Git revision 275c77953ec8c2c896f9085b3508bef2c4d00d2f):

      java.lang.IllegalArgumentException: Illegal initial capacity: -7
      at java.base/java.util.HashMap.<init>(HashMap.java:445)
      at java.base/java.util.HashMap.<init>(HashMap.java:464)
      at org.apache.pdfbox.pdfparser.PDFObjectStreamParser.privateReadObjectNumbers(PDFObjectStreamParser.java:101)
      at org.apache.pdfbox.pdfparser.PDFObjectStreamParser.readObjectNumbers(PDFObjectStreamParser.java:122)
      at org.apache.pdfbox.pdfparser.COSParser.bfSearchForObjStreams(COSParser.java:1644)
      at org.apache.pdfbox.pdfparser.COSParser.rebuildTrailer(COSParser.java:1879)
      at org.apache.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:263)
      at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:127)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:180)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:154)
      at org.apache.pdfbox.Loader.loadPDF(Loader.java:204)
      at com.example.PdfBoxFuzzer.fuzzerTestOneInput(PdfBoxFuzzer.java:31)

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              Meumertzheim Fabian Meumertzheim
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: