pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1831819 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
Date Thu, 17 May 2018 21:59:22 GMT
Author: tilman
Date: Thu May 17 21:59:22 2018
New Revision: 1831819

URL: http://svn.apache.org/viewvc?rev=1831819&view=rev
Log:
PDFBOX-4204: ignore all illegal OpenAction types

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java?rev=1831819&r1=1831818&r2=1831819&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java Thu
May 17 21:59:22 2018
@@ -25,7 +25,6 @@ import org.apache.commons.logging.LogFac
 
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
-import org.apache.pdfbox.cos.COSBoolean;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSObject;
@@ -252,22 +251,7 @@ public class PDDocumentCatalog implement
     public PDDestinationOrAction getOpenAction() throws IOException
     {
         COSBase openAction = root.getDictionaryObject(COSName.OPEN_ACTION);
-        if (openAction == null)
-        {
-            return null;
-        }
-        else if (openAction instanceof COSBoolean)
-        {
-            if (((COSBoolean) openAction).getValue() == false)
-            {
-                return null;
-            }
-            else
-            {
-                throw new IOException("Can't create OpenAction from COSBoolean");
-            }
-        }
-        else if (openAction instanceof COSDictionary)
+        if (openAction instanceof COSDictionary)
         {
             return PDActionFactory.createAction((COSDictionary)openAction);
         }
@@ -277,7 +261,7 @@ public class PDDocumentCatalog implement
         }
         else
         {
-            throw new IOException("Unknown OpenAction " + openAction);
+            return null;
         }
     }
     /**



Mime
View raw message