Enhanced the `detect_linearization` function to avoid false matches when extracting keys from the linearization dictionary. Previous implementation could incorrectly match "/L" within "/Linearized" or "/H" within other keys. Changes: - Added loop-based search in extract_number helper to skip substring matches - Added similar substring-aware logic for /H (hint stream) parsing - Added new diagnostic codes for /Prev chain error handling - Added comprehensive verification note Acceptance criteria PASS: - Non-linearized files return None - Valid linearized dict detected correctly - File size mismatch (incremental update) invalidates linearization - No /H entry returns None for hint_stream_offset - Random bytes never panic (proptest) - Forward scan disabled for linearized files - INV-8 maintained (no panics on arbitrary input) Co-Authored-By: Claude Code <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| pdftract-cer-diff | ||
| pdftract-cli | ||
| pdftract-core | ||
| pdftract-py | ||