Skip to content

fix: validate PDF cross-reference targets before caching objects - #1153

Merged
andiwand merged 1 commit into
mainfrom
review/135-pdf-reference-validation
Oct 6, 2026
Merged

andiwand merged 1 commit into
mainfrom
review/135-pdf-reference-validation

Conversation

@andiwand

@andiwand andiwand commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Malformed PDF cross-references could return an indirect object with another ID or generation, or the wrong member of an object stream. Failed stream state also prevented subsequent seeks, including reads from cached stream objects.

Validate indirect and compressed object identities before caching the result, and clear stream state before object and payload seeks. Parser API comments now state the ownership/lifetime contract concisely; cache rationale lives in the module guide.

Validation: all three regression tests fail on the parent; 83 focused parser, writer, annotation and public PDF tests pass. All 50 PDF corpus metadata/HTML-generation cases pass (no visual comparison). LLVM 22 clang-tidy passes.

@andiwand
andiwand force-pushed the review/134-pdf-xref-generations branch from 5d50960 to 2d08dc0 Compare October 6, 2026 17:39
Base automatically changed from review/134-pdf-xref-generations to main October 6, 2026 17:43
@andiwand
andiwand force-pushed the review/135-pdf-reference-validation branch from 5c7ed52 to 30cea86 Compare October 6, 2026 17:49
@andiwand
andiwand merged commit 844c724 into main Oct 6, 2026
21 of 23 checks passed
@andiwand
andiwand deleted the review/135-pdf-reference-validation branch October 6, 2026 17:54
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