[Poppler-bugs] [Bug 93882] New: Some forms are not saved

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 27 02:45:09 PST 2016


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

            Bug ID: 93882
           Summary: Some forms are not saved
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: mkasik at redhat.com

Created attachment 121323
  --> https://bugs.freedesktop.org/attachment.cgi?id=121323&action=edit
Mark holes in xref table as free entries

I've got downstream report with a PDF form which doesn't save entered data.
I've looked at this in more detail and it seems that the problem is caused by
reconstruction of xref table before saving of the form which causes "reset" of
the form.
The reconstruction is performed because there is a call for XRef::getEntry() on
entry which does not exist (with i = 7 btw). This entry doesn't exist because
there is a hole in the xref table. I was not sure whether the table is correct
then but from https://bugs.freedesktop.org/show_bug.cgi?id=48679 it seems that
it is (and note 17 on section 3.4.3 in specification of PDF 1.7 says that we
should treat such holes as free entries).

Attached is a patch which works for me but I'm not sure whether it doesn't add
another bug elsewhere. It marks newly added entries which where not listed in
previous sections of xref table as free. It doesn't do this if previous size of
the xref table was 0 because this indicates that the PDF is probably linearized
and it would mark some entries as free even if those will be populated later.

It doesn't "chain" the free entries but it seems that it work even without that
(otherwise we would need to reuse the code from beginning of XRef::writeXRef()
which does this).

The original report and the reproducer can be found here:
https://bugzilla.redhat.com/show_bug.cgi?id=1301016

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


More information about the Poppler-bugs mailing list