[Poppler-bugs] [Bug 107057] New: [Patch] Skip XRef gaps in PDFDoc save methods

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jun 27 21:22:48 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107057

            Bug ID: 107057
           Summary: [Patch] Skip XRef gaps in PDFDoc save methods
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: haxtibal at posteo.de

Created attachment 140372
  --> https://bugs.freedesktop.org/attachment.cgi?id=140372&action=edit
Skip XRef xrefEntryNone entries on incremental update and full rewrite

This patch aims to solve Okular bug
https://bugs.kde.org/show_bug.cgi?id=395660. Actually there are several related
problems, the patch fixes the easiest and sufficient part.

Currently, PDFDoc::saveIncrementalUpdate and saveCompleteRewrite iterate over
the full continuous range of XRef::entries, ranging from object id 0 up to
XRef::size. That seems problematic. The range may contain gaps (type ==
xrefEntryNone) which are merely details of popplers memory allocation, but
don't contain objects from the PDF document. Hitting a gap with XRef::getEntry
triggers "damaged file repair". It's implemented by XRef::constructXRef, and it
makes things actually worse because constructXRef can't handle XRef streams nor
objects from inside object streams. It wipes out formerly existing XRef
information in that case.

The idea of this patch is to spare the gaps from iteration, and therefore avoid
a bunch of consecutive faults early.

Atm. the patch is only tested for Okular test case. Poppler regression tests
are yet outstanding.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180627/4d47377c/attachment.html>


More information about the Poppler-bugs mailing list