diff options
| author | 2023-04-03 13:06:07 -0400 | |
|---|---|---|
| committer | 2023-04-03 13:06:07 -0400 | |
| commit | bbdfe1fab1f1706b7e6a62d93951bb451bbeec43 (patch) | |
| tree | 4e6409df2c104c48b14daa8ad182dba07d2110f4 | |
| parent | Merge pull request #10004 from Kelebek1/cubemap (diff) | |
| parent | service: hid: Fix handle validation (diff) | |
| download | yuzu-bbdfe1fab1f1706b7e6a62d93951bb451bbeec43.tar.gz yuzu-bbdfe1fab1f1706b7e6a62d93951bb451bbeec43.tar.xz yuzu-bbdfe1fab1f1706b7e6a62d93951bb451bbeec43.zip | |
Merge pull request #10024 from german77/crysis
service: hid: Fix handle validation
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index b070327ec..8abf71608 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -70,7 +70,6 @@ Result Controller_NPad::VerifyValidSixAxisSensorHandle( | |||
| 70 | const Core::HID::SixAxisSensorHandle& device_handle) { | 70 | const Core::HID::SixAxisSensorHandle& device_handle) { |
| 71 | const auto npad_id = IsNpadIdValid(static_cast<Core::HID::NpadIdType>(device_handle.npad_id)); | 71 | const auto npad_id = IsNpadIdValid(static_cast<Core::HID::NpadIdType>(device_handle.npad_id)); |
| 72 | const bool device_index = device_handle.device_index < Core::HID::DeviceIndex::MaxDeviceIndex; | 72 | const bool device_index = device_handle.device_index < Core::HID::DeviceIndex::MaxDeviceIndex; |
| 73 | const bool npad_type = device_handle.npad_type < Core::HID::NpadStyleIndex::MaxNpadType; | ||
| 74 | 73 | ||
| 75 | if (!npad_id) { | 74 | if (!npad_id) { |
| 76 | return InvalidNpadId; | 75 | return InvalidNpadId; |
| @@ -78,10 +77,6 @@ Result Controller_NPad::VerifyValidSixAxisSensorHandle( | |||
| 78 | if (!device_index) { | 77 | if (!device_index) { |
| 79 | return NpadDeviceIndexOutOfRange; | 78 | return NpadDeviceIndexOutOfRange; |
| 80 | } | 79 | } |
| 81 | // This doesn't get validated on nnsdk | ||
| 82 | if (!npad_type) { | ||
| 83 | return NpadInvalidHandle; | ||
| 84 | } | ||
| 85 | 80 | ||
| 86 | return ResultSuccess; | 81 | return ResultSuccess; |
| 87 | } | 82 | } |
| @@ -1131,6 +1126,7 @@ Result Controller_NPad::DisconnectNpad(Core::HID::NpadIdType npad_id) { | |||
| 1131 | WriteEmptyEntry(shared_memory); | 1126 | WriteEmptyEntry(shared_memory); |
| 1132 | return ResultSuccess; | 1127 | return ResultSuccess; |
| 1133 | } | 1128 | } |
| 1129 | |||
| 1134 | Result Controller_NPad::SetGyroscopeZeroDriftMode( | 1130 | Result Controller_NPad::SetGyroscopeZeroDriftMode( |
| 1135 | const Core::HID::SixAxisSensorHandle& sixaxis_handle, | 1131 | const Core::HID::SixAxisSensorHandle& sixaxis_handle, |
| 1136 | Core::HID::GyroscopeZeroDriftMode drift_mode) { | 1132 | Core::HID::GyroscopeZeroDriftMode drift_mode) { |