Index: src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java
===================================================================
--- src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java	(revision 1629406)
+++ src/main/java/org/apache/pdfbox/pdfparser/NonSequentialPDFParser.java	(working copy)
@@ -1359,17 +1359,24 @@
 
                 if (!endObjectKey.startsWith("endobj"))
                 {
-                    if (endObjectKey.endsWith(" obj") && isLenient)
+                    if (isLenient)
                     {
                         LOG.warn("Object (" + readObjNr + ":" + readObjGen + ") at offset "
                                 + offsetOrObjstmObNr + " does not end with 'endobj' but with '"
                                 + endObjectKey + "'");
-                    }
-                    else
-                    {
-                        throw new IOException("Object (" + readObjNr + ":" + readObjGen
-                                + ") at offset " + offsetOrObjstmObNr
-                                + " does not end with 'endobj' but with '" + endObjectKey + "'");
+                        if (!endObjectKey.endsWith(" obj")) {
+                        	// try to get to an "endobj" string and recover from there
+                        	// this skips spurious closing brackets or other garbage in the file
+                        	while (!endObjectKey.startsWith("endobj") && (pdfSource.read() != -1)) 
+                        	{
+                          	endObjectKey = readString();
+                        	}                        	
+                        }
+                    } 
+                    else {
+                      throw new IOException("Object (" + readObjNr + ":" + readObjGen
+                          + ") at offset " + offsetOrObjstmObNr
+                          + " does not end with 'endobj' but with '" + endObjectKey + "'");                    	
                     }
                 }
 
