[poppler] Branch 'poppler-0.22' - poppler/XRef.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sat Apr 6 14:19:01 PDT 2013


 poppler/XRef.cc |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b312210b630f96baeb8b2f3b49b0b79779609d98
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Apr 6 23:18:18 2013 +0200

    Fix for complete rewrites in repaired files
    
    Part 2 of bug #62985
    if You save a PDF with defect xref offsets, the
    
    readXRefUntil(-1 /* read all xref sections */, &xrefStreamObjNums)
    
    in XRef::scanSpecialFlags() will destroy the already reconstructed entries table, but this means that any modification which the user did in the meantime get lost. This can be tested i.e. with bug168518.pdf.

diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 81e939a..0e76993 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -1556,7 +1556,9 @@ void XRef::scanSpecialFlags() {
   prevXRefOffset = mainXRefOffset;
 
   std::vector<int> xrefStreamObjNums;
-  readXRefUntil(-1 /* read all xref sections */, &xrefStreamObjNums);
+  if (!streamEndsLen) { // don't do it for already reconstructed xref
+    readXRefUntil(-1 /* read all xref sections */, &xrefStreamObjNums);
+  }
 
   // Mark object streams as DontRewrite, because we write each object
   // individually in full rewrite mode.


More information about the poppler mailing list