Skip to content

pdf-parser: recover streams with missing /Length#155

Merged
Velli20 merged 1 commit into
mainfrom
missing-stream-length
May 16, 2026
Merged

pdf-parser: recover streams with missing /Length#155
Velli20 merged 1 commit into
mainfrom
missing-stream-length

Conversation

@Velli20
Copy link
Copy Markdown
Owner

@Velli20 Velli20 commented May 15, 2026

Restore Dictionary::get_or_err to return the normal missing-key error instead of panicking, so malformed PDFs continue through standard error propagation.

Split stream parsing so declared /Length keeps the exact-read path and wrong-length recovery, while missing /Length now scans for a valid endstream terminator, trims the trailing EOL, and fails when no terminator can be recovered.

Add parser and reader regressions for the missing-length recovery path, the no-endstream failure case, and the issue1293r.pdf load case.

Restore Dictionary::get_or_err to return the normal missing-key
error instead of panicking, so malformed PDFs continue through
standard error propagation.

Split stream parsing so declared /Length keeps the exact-read path
and wrong-length recovery, while missing /Length now scans for a
valid endstream terminator, trims the trailing EOL, and fails when
no terminator can be recovered.

Add parser and reader regressions for the missing-length recovery
path, the no-endstream failure case, and the issue1293r.pdf load
case.

Co-authored-by: Codex <codex@openai.com>
@Velli20 Velli20 merged commit 001b3b4 into main May 16, 2026
4 checks passed
@Velli20 Velli20 deleted the missing-stream-length branch May 16, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants