mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
fixed invalid handle destroy
This commit is contained in:
parent
f4eb0b9b9e
commit
9dca00721d
@ -203,9 +203,14 @@ int PS4_SYSV_ABI sceNpTrophyDestroyContext(OrbisNpTrophyContext context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
s32 PS4_SYSV_ABI sceNpTrophyDestroyHandle(OrbisNpTrophyHandle handle) {
|
s32 PS4_SYSV_ABI sceNpTrophyDestroyHandle(OrbisNpTrophyHandle handle) {
|
||||||
|
LOG_INFO(Lib_NpTrophy, "Destroyed handle {}", handle);
|
||||||
if (handle == ORBIS_NP_TROPHY_INVALID_HANDLE)
|
if (handle == ORBIS_NP_TROPHY_INVALID_HANDLE)
|
||||||
return ORBIS_NP_TROPHY_ERROR_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<u32>(handle)})) {
|
if (!trophy_handles.is_allocated({static_cast<u32>(handle)})) {
|
||||||
return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE;
|
return ORBIS_NP_TROPHY_ERROR_INVALID_HANDLE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user