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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Jul 8 19:36:01 UTC 2018


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

--- Comment #14 from Tobias Deiminger <haxtibal at posteo.de> ---
There's a problem with both of my patches: I realized only by now that the
XRef::XRef(BaseStream *strA, ...) Ctor is doing some kind of "lazy load". It
only loads the first table/stream and its entries during construction. The
2..n-th streams (linked by Prev) are not yet loaded. They're actually loaded
later on demand with first access to a missing entry by XRef::getEntry. We get
to this scenario when working with incrementally updated or linearized
documents, because in this case there are more then 1 xref tables/streams.

As a consequence, when a user calls saveXXX, we have to expect that
XRef::entries list may not yet be fully populated. If we simply patch out "load
if missing", we avoid not only the bad recovery, but we avoid also the required
initial load of an entry into memory. I'm not yet sure how to solve it.

-- 
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/20180708/26bf9cd7/attachment.html>


More information about the Poppler-bugs mailing list