Formats: XMA bit reads of 0 or more than 32 bits do not overflow a shift #992
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!992
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/992/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?
@NATON4 on GitHub · 2026-11-24 14:44 UTC · original
formats/xma-bit-widths→main· +46 −1 · 1 files · 1 commits · closed without mergingBits::signed(0)shifted by 32 (a panic in debug builds) andBits::signed(n)/Bits::read(n)for n > 32 underflowed32 - n. Zero bits now read as 0; past 32 bits the low 32 are the value and all n bits are consumed, for both. Widths 1 to 32 read as before.No caller reaches these widths today (the decoder clamps to two channels, so the widest read is 16 bits and
signedis only called with 6); this keeps a later caller or a damaged stream from panicking the decoder. The new test panics on the old code and passes now.Closes #907.
@Zipettte on GitHub · 2026-11-24 15:13 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
87f7cb8:cargo test -p victory-formatspasses, 24 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Pull request closed