On Sun, 2014-06-29 at 18:56 +0200, zyx wrote:
> I think of reverting the patch, to support those "probably broken"
> files, but I'd like to hear from you too, whether the file is truly
> broken.

        Hi,
Dennis, could you try with the attached patch, preferably on current 
trunk, please? It seems to survive on the file you gave a link to, but 
I only tried to open it, not to modify in it or read its objects.
        Thanks and bye,
        zyx


-- 
http://www.litePDF.cz                                 i...@litepdf.cz
Index: src/base/PdfParser.cpp
===================================================================
--- src/base/PdfParser.cpp	(revision 1645)
+++ src/base/PdfParser.cpp	(working copy)
@@ -836,8 +836,18 @@ void PdfParser::ReadXRefStreamContents(
     // Check for a previous XRef stream
     if(xrefObject.HasPrevious()) 
     {
-        m_nIncrementalUpdates++;
-        this->ReadXRefStreamContents( xrefObject.GetPreviousOffset(), bReadOnlyTrailer );
+        try {
+            m_nIncrementalUpdates++;
+            this->ReadXRefStreamContents( xrefObject.GetPreviousOffset(), bReadOnlyTrailer );
+        } catch(PdfError &e) {
+            /* Be forgiving, the error happens when an entry in XRef stream points
+               to a wrong place (offset) in the PDF file. */
+            if( e != ePdfError_NoNumber )
+            {
+                e.AddToCallstack( __FILE__, __LINE__ );
+                throw e;
+            }
+        }
     }
 }
 
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to