From 2f7b8a7149cc223300e1070801435a0caff3313a Mon Sep 17 00:00:00 2001 From: Elad <18193363+elad335@users.noreply.github.com> Date: Tue, 14 Jul 2026 12:17:23 +0300 Subject: [PATCH] Fix sys_rsx_context_iomap error check --- rpcs3/Emu/Cell/lv2/sys_rsx.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp index c91a1aa1aa..9dd49d15f1 100644 --- a/rpcs3/Emu/Cell/lv2/sys_rsx.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_rsx.cpp @@ -419,7 +419,7 @@ error_code sys_rsx_context_iomap(cpu_thread& cpu, u32 context_id, u64 io, u64 ea const auto render = rsx::get_current_renderer(); - if (!size || io & 0xFFFFF || size > 0x200'00000 || size > std::min(~io, ~size) || ea & 0xFFFFF || size & 0xFFFFF) + if (!size || io & 0xFFFFF || size > 0x200'00000 || size > std::min(~io, ~ea) || ea & 0xFFFFF || size & 0xFFFFF) { return CELL_EINVAL; } @@ -464,9 +464,9 @@ error_code sys_rsx_context_iomap(cpu_thread& cpu, u32 context_id, u64 io, u64 ea // TODO: Investigate relaxed memory ordering const u32 prev_ea = table.ea[io + i]; - table.ea[io + i].release((ea + i) << 20); + table.ea[io + i].release(static_cast(ea + i) << 20); if (prev_ea + 1) table.io[prev_ea >> 20].release(-1); // Clear previous mapping if exists - table.io[ea + i].release((io + i) << 20); + table.io[ea + i].release(static_cast(io + i) << 20); } return CELL_OK;