Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data loss splitting pages with indirect XObject or Font #276

Closed
jberkenbilt opened this issue Jan 17, 2019 · 1 comment
Closed

data loss splitting pages with indirect XObject or Font #276

jberkenbilt opened this issue Jan 17, 2019 · 1 comment
Labels

Comments

@jberkenbilt
Copy link
Contributor

This bug was reported to me by email. I am including it here for the record. This is the first silent data loss bug ever found in qpdf. When splitting/merging pages and discarding unreferenced resources, if the /Font or /XObject keys in the page's resource dictionaries were indirect and some XObjects or Fonts were referenced on some but not all of the pages, only images or fonts referenced on all pages would be maintained. The root cause was basically a typo. The comment in the code explained clearly how to handle this case, but the code was actually replacing the dictionaries with themselves rather than with shallow copies of themselves. The fix is a single line of code. The commit that fixes this applies cleanly to all released versions of qpdf from 8.1.0 forward. The bug was introduced in version 8.1.0.

@jberkenbilt
Copy link
Contributor Author

Note that users can run with the --preserve-unreferenced-resources flag to work around the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant