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

java.lang.NegativeArraySizeException in org.apache.pdfbox.pdmodel.graphics.color.PDDeviceGray.createColorModel

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.10
    • Fix Version/s: 1.8.11
    • Component/s: None
    • Labels:
      None

      Description

      The following exception gets logged out when converting some of our PDFs to images:

      java.lang.NegativeArraySizeException
      at org.apache.pdfbox.pdmodel.graphics.color.PDDeviceGray.createColorModel(PDDeviceGray.java:99)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.getRGBImage(PDPixelMap.java:354)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.mask(PDXObjectImage.java:215)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage.applyMasks(PDXObjectImage.java:148)
      at org.apache.pdfbox.pdmodel.graphics.xobject.PDPixelMap.getRGBImage(PDPixelMap.java:366)
      at org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:87)
      at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:557)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:268)
      at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
      at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
      at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:139)
      at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
      at org.apache.pdfbox.util.PDFImageWriter.writeImage(PDFImageWriter.java:130)
      at org.apache.pdfbox.PDFToImage.main(PDFToImage.java:226)
      at org.apache.pdfbox.PDFBox.main(PDFBox.java:96)

      Can be reproduced from the commandline:

      java -jar pdfbox-app-1.8.10.jar PDFToImage 67c9515d-f7dd-4208-aada-c4489e91160c.pdf

        Attachments

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              aleksabl Aleksander Blomskøld
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: