You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2015/10/28 18:33:03 UTC
svn commit: r1711077 -
/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
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))