HLE: reject null output pointers in DirectStorage factory and release FidelityFX DLL on load failure #2580
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!2580
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2580"
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 16:09 UTC · original
reeledMarek:fix/hle-null-out-and-dll-leaks→main· +58 −0 · 2 files · 1 commits · closed without mergingSummary
Fixes two resource leaks on error paths in
victory-hle:dstorage.rs(create_status_array,create_queue): validatesout.is_null()upfront and returnsE_INVALIDARGbefore heap-allocatingInstance<StatusArray>/Instance<Queue>or permanently inserting aLaneintoscheduler().fidelityfx.rs(load): guards theHMODULEreturned byLoadLibraryExWwith an RAIIDropwrapper (FreeLibrary), disarming it only whenOk((host, versions))succeeds, so failed export lookups, missing host GPU, or failedversions()queries do not leak the loaded DLL handle.Testing
null_out_is_rejected_before_creating_status_array_or_queueindstorage.rs.cargo test -p xtask --locked(6/6 passed).@Marvisak on GitHub · 2026-11-25 22:18 UTC · original
Automated triage for the maintainers.
Proposed close: no practical value. Both changes cover cases that do not happen or cost nothing:
dstorage.rs:create_status_arrayandcreate_queuealready returnE_INVALIDARGfor a nullout, throughxgameruntime::put. The new early checks only avoid one small allocation (and one idle lane) for a call that passes no out pointer, which the title does not do. The test checks the error code, whichmainalready returns.fidelityfx.rs:loadruns once and only on the user's own FidelityFX DLL. On failure, keeping the module loaded costs nothing. Freeing it afterversions()has already calledffxQueryon the host device is less safe than leaving it loaded, because the DLL may hold state tied to that device.CI (
check) passes and it merges cleanly. This PR will be closed in 48 hours unless the author pushes a change (for example a real path where the title passes a null out) or a maintainer removes thetriage: proposed closelabel.Generated by Claude Code
@reeledMarek on GitHub · 2026-11-26 05:43 UTC · original
Closing per triage:
xgameruntime::putalready returnsE_INVALIDARGon a null out pointer, and unloading the FidelityFX DLL afterffxQueryis less safe than keeping it loaded. Thanks for the review!Pull request closed