diff --git a/rpcs3/Emu/Cell/Modules/cellVoice.cpp b/rpcs3/Emu/Cell/Modules/cellVoice.cpp index 7c507a26a3..912ec20266 100644 --- a/rpcs3/Emu/Cell/Modules/cellVoice.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVoice.cpp @@ -167,7 +167,7 @@ error_code cellVoiceCreatePort(vm::ptr portId, vm::cptr return CELL_VOICE_ERROR_ARGUMENT_INVALID; } - if (manager.ports.size() > CELLVOICE_MAX_PORT) + if (manager.ports.size() >= CELLVOICE_MAX_PORT) return CELL_VOICE_ERROR_RESOURCE_INSUFFICIENT; // Id: bits [8,15] seem to contain a "random" value @@ -427,6 +427,8 @@ error_code cellVoiceInitEx(vm::ptr pArg) auto& manager = g_fxo->get(); + std::lock_guard lock(manager.mtx); + if (manager.is_init) return CELL_VOICE_ERROR_LIBVOICE_INITIALIZED;