mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-25 11:56:18 +00:00
fix potential out of bound crash (#3132)
This commit is contained in:
parent
8dcd9cc0f9
commit
a62027d4c2
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue