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

Handling of invalid annotation border

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.4
    • 2.0.5, 3.0.0 PDFBox
    • Rendering
    • None
    • Latest in branch 2.0

    Description

      We came across a doc where a link annotation border was set to an array of one element [0], maybe PDAnnotation::getBorder should check the array instance has a valid size too.

      java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:258)
          sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
          java.security.AccessController.doPrivileged(Native Method)
          java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
      Caused by: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:247)
          sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
          java.security.AccessController.doPrivileged(Native Method)
          java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
      Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
          java.util.ArrayList.rangeCheck(ArrayList.java:653)
          java.util.ArrayList.get(ArrayList.java:429)
          org.apache.pdfbox.cos.COSArray.get(COSArray.java:210)
          org.apache.pdfbox.rendering.PageDrawer.getAnnotationBorder(PageDrawer.java:1110)
          org.apache.pdfbox.rendering.PageDrawer.drawAnnotationLinkBorder(PageDrawer.java:1162)
          org.apache.pdfbox.rendering.PageDrawer.showAnnotation(PageDrawer.java:1083)
          org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:198)
          org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:145)
          org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:68)
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:236)
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:1)
          java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              torakiki Andrea Vacondio
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: