Skip to content

fix: handle PDF file boundaries and final cross-reference markers - #1151

Merged
andiwand merged 1 commit into
mainfrom
review/133-pdf-file-boundaries
Oct 6, 2026
Merged

andiwand merged 1 commit into
mainfrom
review/133-pdf-file-boundaries

Conversation

@andiwand

@andiwand andiwand commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

PDF file traversal consumed the first object when the optional binary-marker comment was absent, missed versioned header entries and objects sharing a line, and left EOF entries unconsumed. Trailer seeking picked the first marker and could loop indefinitely when entered with failed stream state.

Read only actual header comments, detect indirect objects by their leading number, and consume EOF. Trailer seeking clears stream state, checks progress, and selects the last complete startxref line in the final 1024 bytes.

Validation: the parent fails header traversal and hangs in the failed-stream trailer regression (terminated). All 71 focused file/parser/writer/annotation tests pass, including partial-line boundaries and optional comments; LLVM 22 clang-tidy passes.

@andiwand
andiwand force-pushed the review/132-pdf-color-validation branch from c17a83d to 0df3144 Compare October 6, 2026 17:24
Base automatically changed from review/132-pdf-color-validation to main October 6, 2026 17:28
@andiwand
andiwand force-pushed the review/133-pdf-file-boundaries branch from 9782e86 to 525d513 Compare October 6, 2026 17:33
@andiwand
andiwand merged commit e392f60 into main Oct 6, 2026
23 of 25 checks passed
@andiwand
andiwand deleted the review/133-pdf-file-boundaries branch October 6, 2026 17:35
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.

1 participant