From ec9622b5138067dc6d834ca607a40a0b42cdf301 Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 15 Nov 2019 12:17:35 +0200 Subject: [PATCH] Fix ppu_patch invalid address check --- rpcs3/Emu/Cell/PPUThread.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 3752f5f1f7..f5ab6b62e6 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -408,16 +408,12 @@ extern bool ppu_patch(u32 addr, u32 value) return false; } - const auto ptr = vm::get_super_ptr(addr); - - if (!ptr) + if (!vm::try_access(addr, &value, sizeof(value), true)) { LOG_FATAL(GENERAL, "Patch failed at 0x%x: invalid memory address.", addr); return false; } - *ptr = value; - const u32 _break = ::narrow(reinterpret_cast(&ppu_break)); const u32 fallback = ::narrow(reinterpret_cast(&ppu_fallback));