Guard against null output buffer in xg::tiling #461

Closed
ahmetbagci8 wants to merge 660 commits from upstream-pr/461 into main
ahmetbagci8 commented 2026-11-29 20:51:23 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by ahmetbagci8 on 2026-11-29T20:51:23Z.


Problem

In crates/victory-hle/src/modules/xg.rs, iling() writes SubresourceTiling entries through out.add(i as usize).write(entry) whenever count is non-null and *count > 0, without checking whether out is null. Passing a null out buffer to query the subresource tiling count immediately dereferences null.

Fix

Skip writing entries when out.is_null() and report the available subresource tiling count in *n instead. Extended layout_and_copies_through_the_object to verify querying with out = null alongside the existing non-null check.

Verification

  • cargo test -p victory-hle --lib xg::tests (4 passed, 0 failed)
  • cargo clippy -p victory-hle --tests (0 warnings)
<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5554987288 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/461). Originally posted by [ahmetbagci8](https://github.com/ahmetbagci8) on 2026-11-29T20:51:23Z. --- ## Problem In crates/victory-hle/src/modules/xg.rs, iling() writes SubresourceTiling entries through out.add(i as usize).write(entry) whenever count is non-null and *count > 0, without checking whether out is null. Passing a null out buffer to query the subresource tiling count immediately dereferences null. ## Fix Skip writing entries when out.is_null() and report the available subresource tiling count in *n instead. Extended layout_and_copies_through_the_object to verify querying with out = null alongside the existing non-null check. ## Verification - cargo test -p victory-hle --lib xg::tests (4 passed, 0 failed) - cargo clippy -p victory-hle --tests (0 warnings)
TaynanGT commented 2026-11-30 17:05:13 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:05:13Z.


main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285696818 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/461#issuecomment-7285696818). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:05:13Z. --- `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
TaynanGT/Vice-Tay!461
No description provided.