pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1779800 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotation.java
Date Sun, 22 Jan 2017 12:38:43 GMT
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);



Mime
View raw message