Fixup validity check in mmnv IRequest::Get

Fixes a random crash in SMO when launching the game for the first time.
This commit is contained in:
Billy Laws 2021-06-27 14:46:36 +01:00
parent 100cff7692
commit 5be7860cf7

View File

@ -126,10 +126,9 @@ namespace skyline::service::mmnv {
Result IRequest::Get(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
u32 id{request.Pop<u32>()};
u32 freqHz{request.Pop<u32>()};
std::lock_guard lock(requestsMutex);
if (id >= requests.size()) {
if (id < requests.size()) {
auto &req{requests[id]};
if (req) {
state.logger->Debug("Get frequency for request {}: {} Hz", id, req->freqHz);