pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1656363 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
Date Sun, 01 Feb 2015 21:43:11 GMT
Author: tilman
Date: Sun Feb  1 21:43:11 2015
New Revision: 1656363

URL: http://svn.apache.org/r1656363
Log:
PDFBOX-2652: avoid class cast exception if 2nd array element of destination is wrong

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java?rev=1656363&r1=1656362&r2=1656363&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
Sun Feb  1 21:43:11 2015
@@ -51,10 +51,12 @@ public abstract class PDDestination impl
         {
             //this is ok, just return null.
         }
-        else if( base instanceof COSArray && ((COSArray)base).size() > 0 )
+        else if (base instanceof COSArray 
+                && ((COSArray) base).size() > 1 
+                && ((COSArray) base).getObject(1) instanceof COSName)
         {
             COSArray array = (COSArray)base;
-            COSName type = (COSName)array.getObject( 1 );
+            COSName type = (COSName) array.getObject(1);
             String typeString = type.getName();
             if( typeString.equals( PDPageFitDestination.TYPE ) ||
                 typeString.equals( PDPageFitDestination.TYPE_BOUNDED ))



Mime
View raw message