You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used origami to create a password-encrypted PDF to attempt to reproduce #159, and I found that pdf-rs is intolerant of files where the /Size of a cross-reference stream is too small for its contents.
I produced this file with the following script, from the existing pdf-sample.pdf.
By inspection, it's clear that the modifications origami made to the trailer's dictionary are inconsistent. The /Index ends with "28 2", yet the /Size is only 27. When this file is loaded, the last subsection of the cross reference stream is successfully parsed, but then XRefTable::add_entries_from() discards both entries in the subsection (with IDs 28 and 29) because they don't fit in the vector. Thus, future indirect references to the objects fail to resolve. (Soon after, opening the file fails with "Entry 28 in xref table unspecified")
Should Backend::read_xref_table_and_trailer() scan the /Index array and update the table's size if necessary?
The text was updated successfully, but these errors were encountered:
I used origami to create a password-encrypted PDF to attempt to reproduce #159, and I found that pdf-rs is intolerant of files where the
/Size
of a cross-reference stream is too small for its contents.I produced this file with the following script, from the existing
pdf-sample.pdf
.By inspection, it's clear that the modifications
origami
made to the trailer's dictionary are inconsistent. The/Index
ends with "28 2", yet the/Size
is only 27. When this file is loaded, the last subsection of the cross reference stream is successfully parsed, but thenXRefTable::add_entries_from()
discards both entries in the subsection (with IDs 28 and 29) because they don't fit in the vector. Thus, future indirect references to the objects fail to resolve. (Soon after, opening the file fails with "Entry 28 in xref table unspecified")Should
Backend::read_xref_table_and_trailer()
scan the/Index
array and update the table's size if necessary?The text was updated successfully, but these errors were encountered: