mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-15 00:03:16 +00:00
Fixed crash when using the NVIDIA Shield controller
This commit is contained in:
@@ -482,13 +482,13 @@ static bool HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
#ifdef DEBUG_SHIELD_PROTOCOL
|
||||
HIDAPI_DumpPacket("NVIDIA SHIELD packet: size = %d", data, size);
|
||||
#endif
|
||||
if (!joystick) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Byte 0 is HID report ID
|
||||
switch (data[0]) {
|
||||
case k_ShieldReportIdControllerState:
|
||||
if (!joystick) {
|
||||
break;
|
||||
}
|
||||
if (size == 16) {
|
||||
HIDAPI_DriverShield_HandleStatePacketV103(joystick, ctx, data, size);
|
||||
} else {
|
||||
@@ -496,9 +496,6 @@ static bool HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device)
|
||||
}
|
||||
break;
|
||||
case k_ShieldReportIdControllerTouch:
|
||||
if (!joystick) {
|
||||
break;
|
||||
}
|
||||
HIDAPI_DriverShield_HandleTouchPacketV103(joystick, ctx, data, size);
|
||||
break;
|
||||
case k_ShieldReportIdCommandResponse:
|
||||
|
||||
Reference in New Issue
Block a user