pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1657397 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
Date Wed, 04 Feb 2015 20:55:55 GMT
Author: tilman
Date: Wed Feb  4 20:55:55 2015
New Revision: 1657397

URL: http://svn.apache.org/r1657397
Log:
PDFBOX-1859: detect malformed destinations

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

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java?rev=1657397&r1=1657396&r2=1657397&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/documentnavigation/destination/PDDestination.java
Wed Feb  4 20:55:55 2015
@@ -51,7 +51,9 @@ 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 );
@@ -81,7 +83,7 @@ public abstract class PDDestination impl
             }
             else
             {
-                throw new IOException( "Unknown destination type:" + type );
+                throw new IOException( "Unknown destination type: " + type.getName() );
             }
         }
         else if( base instanceof COSString )



Mime
View raw message