bink_index: refuse an incomplete embedded stream before probing #2252
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2252
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/bink-index-truncated-probe-copy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: BINK-INDEX-TRUNCATED-PROBE-COPY
What and why
An archive can shrink between indexing and probing. Detect EOF before the indexed byte count has been copied, clean up the temporary stream and report a failed probe. The regression truncates a synthetic archive by one byte and verifies that ffprobe never receives the partial file.
Tested
Windows, Python 3.14.7. The regression failed on the parent commit and passed with this change.
python -I tests/test_bink_index.pygit diff --checkand the changed-path no-game-data scan passed.GPUs tested: N/A (synthetic CPU tests).
AI-assisted: Yes.
Checklist
Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.
tests/test_bink_index.py: 35 passed, 14 subtests passed (main: 34 passed).(AI-assisted test run; output checked by hand.)
Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_bink_index.py: 35 tests OK. The PR's test file against main's tools/bink_index.py: 1 failure, so the new test fails on main and passes with the change. compileall clean.
Two other open PRs touch tools/bink_index.py (#2221 and #1022). This one merges cleanly with each, and with #2221 merged as well, tests/test_bink_index.py still passes.
AI-assisted: yes (Claude Code)
Approving a58ea6b4f.
An embedded stream shorter than its declared size is now an error instead of a silently truncated temp file handed to the probe.
Merged onto
maind1dff7949in one batch with 22 other tool PRs of this series (no conflicts), on Linux with Python 3.13.tests/test_bink_index.py: 35 passed (main: 34). AI-assisted (Claude Code, Claude Opus 5.5).Red/green: tests/test_bink_index.py fails on main (a truncated embedded stream is still probed as bink2) and passes with the PR merged, on GitHub Actions Linux and natively on Windows.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)
Verified by OreoFR
4a54aedcb+ PR heada58ea6b4fpython -I tests/test_bink_index.pyAI-assisted (Claude Code, Claude Opus 5.5).