mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-12 04:31:29 -06:00
Prevent Rasterizer::IsMapped from returning true for memory ranges that wrap the address space (#3989)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Signed-off-by: Dasaav-dsv <simplydasaav@gmail.com>
This commit is contained in:
parent
d3c6abac4e
commit
e2f3a0f750
@ -1015,6 +1015,10 @@ bool Rasterizer::IsMapped(VAddr addr, u64 size) {
|
||||
// There is no memory, so not mapped.
|
||||
return false;
|
||||
}
|
||||
if (static_cast<u64>(addr) > std::numeric_limits<u64>::max() - size) {
|
||||
// Memory range wrapped the address space, cannot be mapped.
|
||||
return false;
|
||||
}
|
||||
const auto range = decltype(mapped_ranges)::interval_type::right_open(addr, addr + size);
|
||||
|
||||
Common::RecursiveSharedLock lock{mapped_ranges_mutex};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user