Guard texture and XMA offsets against overflow #50
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!50
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/50/head"
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?
@Vanthys on GitHub · 2026-11-23 23:47 UTC · original
Vanthys:fix/format-offset-overflow→main· +48 −2 · 2 files · 2 commits · merged 2026-11-24 00:34 UTCUse 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.@DaviTostes on GitHub · 2026-11-23 23:51 UTC · original
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).
@lordon1a on GitHub · 2026-11-24 00:19 UTC · original
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.