Browse Source
Merge pull request #1817 from DarkLordZach/npad-idx-fix
npad: Use NPadIdToIndex to prevent invalid array access
pull/15/merge
bunnei
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
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) { |
|
|
|
|