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

Signed-off-by: Dasaav-dsv <simplydasaav@gmail.com>
This commit is contained in:
Dasaav 2026-02-02 19:51:50 +01:00 committed by GitHub
parent d3c6abac4e
commit e2f3a0f750
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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};