From 299224790c7dfafb77e10248dee35b83c6e63cbb Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Wed, 28 Nov 2018 09:01:58 -0500 Subject: npad: Use NPadIdToIndex to prevent invalid array access --- src/core/hle/service/hid/controllers/npad.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle') 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) { -- cgit v1.2.3