From b55c3f45559a0a5685b879adbe4c220c7304f859 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Thu, 22 May 2025 15:35:00 +0300 Subject: [PATCH] Trophy fix (#2975) * fixed invalid handle destroy * removed log --- src/core/libraries/np_trophy/np_trophy.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/libraries/np_trophy/np_trophy.cpp b/src/core/libraries/np_trophy/np_trophy.cpp index a951d5655..6de84bd93 100644 --- a/src/core/libraries/np_trophy/np_trophy.cpp +++ b/src/core/libraries/np_trophy/np_trophy.cpp @@ -206,6 +206,10 @@ s32 PS4_SYSV_ABI sceNpTrophyDestroyHandle(OrbisNpTrophyHandle 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; }