summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-11-28 23:46:17 +0100
committerGitHub <noreply@github.com>2018-11-28 23:46:17 +0100
commitc5ab648554520c1828125ea1862831391aee3830 (patch)
treeb3b6d7964fe8a7624e150b6275b9abe3a4efecb7
parentMerge pull request #1792 from bunnei/dma-pusher (diff)
parentnpad: Use NPadIdToIndex to prevent invalid array access (diff)
downloadyuzu-c5ab648554520c1828125ea1862831391aee3830.tar
yuzu-c5ab648554520c1828125ea1862831391aee3830.tar.gz
yuzu-c5ab648554520c1828125ea1862831391aee3830.tar.bz2
yuzu-c5ab648554520c1828125ea1862831391aee3830.tar.lz
yuzu-c5ab648554520c1828125ea1862831391aee3830.tar.xz
yuzu-c5ab648554520c1828125ea1862831391aee3830.tar.zst
yuzu-c5ab648554520c1828125ea1862831391aee3830.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 46604887c..a089bf159 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -575,8 +575,8 @@ void Controller_NPad::AddNewControllerAt(NPadControllerType controller, u32 npad
return;
}
- connected_controllers[npad_id] = {controller, true};
- InitNewlyAddedControler(npad_id);
+ connected_controllers[NPadIdToIndex(npad_id)] = {controller, true};
+ InitNewlyAddedControler(NPadIdToIndex(npad_id));
}
void Controller_NPad::ConnectNPad(u32 npad_id) {