From 5ddd87d74232ee3263e1fc133b6f41c0d98ebd96 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Sat, 20 Jun 2026 02:20:32 -0400 Subject: [PATCH] Properly handle search_end restrictions in sceKernelAllocateDirectMemory (#4600) --- src/core/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 2f0cf6ef1..911776de7 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -256,7 +256,7 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, u64 size, u6 mapping_end = mapping_start + size; } - if (dmem_area == dmem_map.end()) { + if (dmem_area == dmem_map.end() || mapping_end > search_end) { // There are no suitable mappings in this range LOG_ERROR(Kernel_Vmm, "Unable to find free direct memory area: size = {:#x}", size); return -1;