Guard texture and XMA offsets against overflow #50
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/50"
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?
Imported from Marvisak/VIctory. Originally posted by Vanthys on 2026-11-23T23:47:20Z.
Use checked arithmetic for texture copy pitches and XMA packet offsets. Add synthetic regression tests for overflowing row and depth pitches, an out-of-range packet index, and a truncated packet header. Make the saved-stream XMA test fail when its fixture directory is empty.
Verified with stable
rustc: 20 format tests passed. The three external-fixture tests were skipped in the normal run. A separate run confirmed that the saved-stream test rejects an empty directory.Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-23T23:51:45Z.
Tested
4cca767stacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass.mainalone does not build on Linux (E0425 invictory-gpu), so the check uses #39 as the base; the merge is clean.cargo test --workspace: 156 passed, 0 failed, 3 ignored.texture_copies_reject_overflowing_pitches,volume_copy_rejects_overflowing_depth_pitchandpacket_rejects_out_of_range_indices_and_partial_headers. No game data used.AI-assisted (DeepSeek V4.1 Flash coding agent).
Imported from Marvisak/VIctory. Originally posted by lordon1a on 2026-11-24T00:19:59Z.
Verified
4cca76795on Windows 11 (x86_64-pc-windows-gnullvm,rustc 1.100.0, applied cleanly tomain@35b054ec0): pass.cargo xtask policy: 150 files okcargo test -p victory-formats: 20 passed, 0 failed, 3 ignored (+3 new overflow guard tests intexture.rs/xma.rs).AI-assisted.