mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
maxwell_dma: Check for valid source in destination before copy.
- Avoid a crash in Octopath Traveler.
This commit is contained in:
parent
197dcf0b5e
commit
19330f45d3
1 changed files with 10 additions and 0 deletions
|
@ -88,6 +88,16 @@ void MaxwellDMA::HandleCopy() {
|
||||||
auto source_ptr{memory_manager.GetPointer(source)};
|
auto source_ptr{memory_manager.GetPointer(source)};
|
||||||
auto dst_ptr{memory_manager.GetPointer(dest)};
|
auto dst_ptr{memory_manager.GetPointer(dest)};
|
||||||
|
|
||||||
|
if (!source_ptr) {
|
||||||
|
LOG_ERROR(HW_GPU, "source_ptr is invalid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dst_ptr) {
|
||||||
|
LOG_ERROR(HW_GPU, "dst_ptr is invalid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto FlushAndInvalidate = [&](u32 src_size, u64 dst_size) {
|
const auto FlushAndInvalidate = [&](u32 src_size, u64 dst_size) {
|
||||||
// TODO(Subv): For now, manually flush the regions until we implement GPU-accelerated
|
// TODO(Subv): For now, manually flush the regions until we implement GPU-accelerated
|
||||||
// copying.
|
// copying.
|
||||||
|
|
Loading…
Reference in a new issue