Repository navigation
awc_opus: clear error for packets over 255 Ogg segments (AWC-OPUS-OGG-SEGMENT-LIMIT) - #6336
Conversation
|
Two boundary details from checking
For the two-packet control I used the three-byte Opus silence packet and |
shayderrr
left a comment
There was a problem hiding this comment.
Review
Reviewed change in PR #6336: awc_opus: clear error for packets over 255 Ogg segments (AWC-OPUS-OGG-SEGMENT-LIMIT).
Scope: tests/test_awc_opus.py, tools/awc_opus.py
Diff: +9 / -0 across 2 file(s).
The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.
Reviewed by shayderrr via batch review.
|
Thanks @cloph-dsp - I went through this change and the diff around tests/test_awc_opus.py. The change is tight, the rationale matches the code, and nothing here needs another pass from my side. Approved and squash-merging it into main now. Nice work. |
Claim:
AWC-OPUS-OGG-SEGMENT-LIMIT(claimed in #6214).ogg_page()built the lacing table without checking the Ogg limit of 255 segments per page. A malformed AWC bank with a u16 Opus packet length of 65025 bytes or more hitstruct.error: 'B' format requires 0 <= number <= 255with no context. It now raisesValueError("packet needs more than 255 Ogg segments").Added
tests/test_awc_opus.py::OggCrcTest::test_page_segment_limit, which checks the largest valid single-packet page (65024 bytes: 254 full segments plus a partial one) and the first invalid length (65025, which needs an extra zero segment).No game files, extracted assets or logs are included.
AI-assisted (Hy4 flash).
Testing (Windows, Python 3.14.6):
python -I tests/test_awc_opus.py- 56 tests OKpython -I tests/test_audio_wav.py- 40 OK (17 skipped: ffmpeg not installed)python -I tests/test_awc_manifest.py- 20 OK (2 skipped)python -I tests/test_awc_markers.py- 8 OKpython -I tests/test_audio_config.py- 21 OKpython -I tests/test_awc_names.py- 30 OKpython -I tests/test_awc_shorts.py- 13 OKpython -I tests/test_rsc8_audio.py- 37 OKpython -I tests/test_audio_stage_resume.py- 12 OKpython -m compileall -q make_game.py tools tests- cleanpython -I tests/test_opus_tags.py- 1 pre-existing failure (test_cli_reports_incomplete_directory_discovery, repr-doubled Windows paths), already covered by open PRs tools: print Windows paths in error messages without repr() doubling #6049/tools: print a refused or unreadable path as typed, not through repr() (5 tests fail on Windows) #5927/tools: print the plain path, not a repr'd one, in OSError messages #5760 and unrelated to this change.GPU/driver: N/A - pure Python tool change, no GPU code paths.