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

EmptyStackException in PDFStreamEngine.getColorSpaces

    Details

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

      Description

      From Abel S. in the user mailing list:

      I'm testing prawn generated PDFs (https://github.com/prawnpdf/prawn) and I have found that when trying to validate them with PreflightParser, I get an unchecked exception instead of an expected org.apache.pdfbox.preflight.exception.ValidationException.

      I attach the PDF (example-manual.pdf) and here is the stacktrace:

      Exception in thread "main" java.util.EmptyStackException
      	at java.util.Stack.peek(Stack.java:102)
      	at org.apache.pdfbox.util.PDFStreamEngine.getColorSpaces(PDFStreamEngine.java:579)
      	at org.apache.pdfbox.util.operator.SetNonStrokingColorSpace.process(SetNonStrokingColorSpace.java:50)
      	at org.apache.pdfbox.preflight.content.ContentStreamWrapper.processOperator(ContentStreamWrapper.java:162)
      	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:268)
      	at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:244)
      	at org.apache.pdfbox.preflight.content.ContentStreamWrapper.validXObjContentStream(ContentStreamWrapper.java:100)
      	at org.apache.pdfbox.preflight.xobject.XObjFormValidator.validateXObjectContent(XObjFormValidator.java:113)
      	at org.apache.pdfbox.preflight.xobject.XObjFormValidator.validate(XObjFormValidator.java:76)
      	at org.apache.pdfbox.preflight.process.reflect.GraphicObjectPageValidationProcess.validate(GraphicObjectPageValidationProcess.java:77)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:81)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:54)
      	at org.apache.pdfbox.preflight.process.reflect.ResourcesValidationProcess.validateXObjects(ResourcesValidationProcess.java:191)
      	at org.apache.pdfbox.preflight.process.reflect.ResourcesValidationProcess.validate(ResourcesValidationProcess.java:78)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:81)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:54)
      	at org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validateResources(SinglePageValidationProcess.java:163)
      	at org.apache.pdfbox.preflight.process.reflect.SinglePageValidationProcess.validate(SinglePageValidationProcess.java:82)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:81)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:54)
      	at org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validatePage(PageTreeValidationProcess.java:58)
      	at org.apache.pdfbox.preflight.process.PageTreeValidationProcess.validate(PageTreeValidationProcess.java:47)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:81)
      	at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:96)
      	at org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:168)
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: