HLE: avoid null pointer dereference in XG GetResourceTiling count queries #2524
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2526"
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 reeledMarek on 2026-11-25T15:16:43Z.
Problem
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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:55:28Z.
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
Imported from Marvisak/VIctory. Originally posted by reeledMarek on 2026-11-25T20:05:34Z.
Closing per triage — checked D3D12
GetResourceTilingdocumentation and confirmed there is no documented null-array count query mode. Thanks for the review!Pull request closed