mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 10:35:03 +00:00
fix potential out of bound crash
This commit is contained in:
parent
5bc4cc761a
commit
650281bf9c
@ -199,6 +199,10 @@ int PS4_SYSV_ABI sceNpTrophyDestroyContext(OrbisNpTrophyContext context) {
|
||||
Common::SlotId contextId;
|
||||
contextId.index = context - 1;
|
||||
|
||||
if (contextId.index >= trophy_contexts.size()) {
|
||||
return ORBIS_NP_TROPHY_ERROR_INVALID_CONTEXT;
|
||||
}
|
||||
|
||||
ContextKey contextkey = trophy_contexts[contextId];
|
||||
trophy_contexts.erase(contextId);
|
||||
contexts_internal.erase(contextkey);
|
||||
|
Loading…
Reference in New Issue
Block a user