HLE: reject null output pointers in DirectStorage factory and release FidelityFX DLL on load failure #2578
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by reeledMarek on 2026-11-25T16:09:07Z.
Summary
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).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:18:42Z.
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
Imported from Marvisak/VIctory. Originally posted by reeledMarek on 2026-11-26T05:43:34Z.
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