You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2017/01/22 12:38:43 UTC

svn commit: r1779800 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java

Author: tilman
Date: Sun Jan 22 12:38:43 2017
New Revision: 1779800

URL: http://svn.apache.org/viewvc?rev=1779800&view=rev
Log:
PDFBOX-3660: return default border if not enough elements

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java?rev=1779800&r1=1779799&r2=1779800&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java Sun Jan 22 12:38:43 2017
@@ -627,8 +627,8 @@ public abstract class PDAnnotation imple
     }
 
     /**
-     * This will retrieve the border array. If none is available, it will return the default, which
-     * is [0 0 1].
+     * This will retrieve the border array. If none is available or if it doesn't have at least
+     * three elements, it will return the default, which is [0 0 1].
      *
      * @return the border array.
      */
@@ -636,7 +636,7 @@ public abstract class PDAnnotation imple
     {
         COSBase base = getCOSObject().getDictionaryObject(COSName.BORDER);
         COSArray border;
-        if (!(base instanceof COSArray))
+        if (!(base instanceof COSArray) || ((COSArray) base).size() < 3)
         {
             border = new COSArray();
             border.add(COSInteger.ZERO);