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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jul 9 22:02:55 UTC 2018


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

Tobias Deiminger <haxtibal at posteo.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #140484|0                           |1
        is obsolete|                            |

--- Comment #15 from Tobias Deiminger <haxtibal at posteo.de> ---
Created attachment 140530
  --> https://bugs.freedesktop.org/attachment.cgi?id=140530&action=edit
Skip XRef::constructXRef in XRef::readXRefUntil if last XRef section is a
stream

Here's an approach to avoid the problem described in comment 14. We let the
lazy load during PDFDoc::saveXXX happen, but avoid corruption of the XRef by
skipping constructXRef in XRef::readXRefUntil for situations where we know it
won't work.

Afaikt XRef::fetch does the same for the same reason, checkout commit 57b7a52c.

When using the patch in the okular test case, we'll get a single "Error:
Invalid XRef entry 0" on console, but saved file works. I think that's ok, as
the original file is actually buggy and it should be noted somewhere.

Tests from comment 1 pass.

-- 
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/20180709/90c21b00/attachment.html>


More information about the Poppler-bugs mailing list