HLE: avoid null pointer dereference in XG GetResourceTiling count queries #2526
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!2526
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2526/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?
@reeledMarek on GitHub · 2026-11-25 15:16 UTC · original
reeledMarek:fix/hle-xg-tiling-null-out→main· +42 −21 · 1 files · 1 commits · closed without mergingProblem
In
xg::tiling(GetResourceTiling), whencountis non-null (*count > 0) andoutis null (the standard count-query call pattern), the loop unconditionally dereferencedout.add(i).write(entry), causing an immediate null-pointer write crash.Fix
out.is_null(): when null, write the available subresource tiling count to*countand returnS_OKwithout dereferencingout.Testing
outcount-query assertion to the existing tiling test incrates/victory-hle/src/modules/xg.rs.cargo test -p xtask --lockedpasses asset policy.@Marvisak on GitHub · 2026-11-25 15:55 UTC · original
Automated triage for the maintainers. Needs work.
The PR makes
tilingin crates/victory-hle/src/modules/xg.rs treat a nulloutwith a non-nullcountas a count query that returns the number of available entries. That is new runtime behaviour, and the PR gives no evidence for it: the code on main documentsoutas having room for*countentries, and the equivalent host D3D12GetResourceTilingdocuments no null-array count query. The added test asserts the new behaviour rather than a known one. What would move this forward: evidence that the title (or the real library) calls this with a null array and expects the count back, such as the call site in the title's code or public documentation. Without that, this is a guard for a call that does not happen. CI: thecheckjob passes.Generated by Claude Code
@reeledMarek on GitHub · 2026-11-25 20:05 UTC · original
Closing per triage — checked D3D12
GetResourceTilingdocumentation and confirmed there is no documented null-array count query mode. Thanks for the review!Pull request closed