pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1711077 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
Date Wed, 28 Oct 2015 17:33:03 GMT
Author: tilman
Date: Wed Oct 28 17:33:03 2015
New Revision: 1711077

URL: http://svn.apache.org/viewvc?rev=1711077&view=rev
Log:
PDFBOX-3060: avoid ClassCastException if root is not a dictionary

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java?rev=1711077&r1=1711076&r2=1711077&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
Wed Oct 28 17:33:03 2015
@@ -406,6 +406,10 @@ public class NonSequentialPDFParser exte
         }
         else
         {
+            if (!(rootObject instanceof COSDictionary))
+            {
+                throw new IOException("Expected root dictionary, but got this: " + rootObject);
+            }
             COSDictionary rootDictionary = (COSDictionary)rootObject; 
             // in some pdfs the type value "Catalog" is missing in the root object
             if (isLenient() && !rootDictionary.containsKey(COSName.TYPE))



Mime
View raw message