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

NullPointerException when rendering shading with no function

    Details

      Description

      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
              at org.apache.pdfbox.pdmodel.graphics.shading.PDShading.getFunctionsArray(PDShading.java:354)
              at org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:386)
              at org.apache.pdfbox.pdmodel.graphics.shading.PDShading.evalFunction(PDShading.java:374)
              at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.calcColorTable(AxialShadingContext.java:151)
              at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingContext.<init>(AxialShadingContext.java:128)
              at org.apache.pdfbox.pdmodel.graphics.shading.AxialShadingPaint.createContext(AxialShadingPaint.java:67)
      

      Found at https://github.com/mozilla/pdf.js/issues/5509 . The cause of the bug is that we're not throwing an exception for a missing function. Fun fact: Adobe Reader isn't able to display the file correctly, the contents of the yellow box are missing.

        Attachments

        1. PDFJS-5509.pdf
          74 kB
          Tilman Hausherr

          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: