Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • P poppler
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 656
    • Issues 656
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 43
    • Merge requests 43
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • poppler
  • poppler
  • Issues
  • #483

Closed
Open
Created Jan 27, 2016 by Bugzilla Migration User@bugzilla-migration

Some forms are not saved

Submitted by Marek Kasik @mkasik

Assigned to poppler-bugs

Link to original bug (#93882)

Description

Created attachment 121323 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

Attachment 121323, "Mark holes in xref table as free entries":
0001-Mark-holes-in-xref-table-as-free.patch

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking