From 9dca00721d47eb14fc578f37d8a4cdae29f35a4e Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 22 May 2025 14:08:03 +0300 Subject: [PATCH] fixed invalid handle destroy --- src/core/libraries/np_trophy/np_trophy.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/libraries/np_trophy/np_trophy.cpp b/src/core/libraries/np_trophy/np_trophy.cpp index a951d5655..8a725636a 100644 --- a/src/core/libraries/np_trophy/np_trophy.cpp +++ b/src/core/libraries/np_trophy/np_trophy.cpp @@ -203,9 +203,14 @@ int PS4_SYSV_ABI sceNpTrophyDestroyContext(OrbisNpTrophyContext context) { } s32 PS4_SYSV_ABI sceNpTrophyDestroyHandle(OrbisNpTrophyHandle handle) { + LOG_INFO(Lib_NpTrophy, "Destroyed handle {}", handle); if (handle == ORBIS_NP_TROPHY_INVALID_HANDLE) return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE; + if (handle >= trophy_handles.size()) { + LOG_ERROR(Lib_NpTrophy, "Invalid handle {}", handle); + return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE; + } if (!trophy_handles.is_allocated({static_cast(handle)})) { return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE; }