Commit 9c3aa7f0553c0dda250575d567f8b536a6402ec4

Sam Lantinga 2021-02-06T15:43:17

SDL: fix packet handling for original version of Stadia FW

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/joystick/hidapi/SDL_hidapi_stadia.c b/src/joystick/hidapi/SDL_hidapi_stadia.c
index 7bf4731..e11d249 100644
--- a/src/joystick/hidapi/SDL_hidapi_stadia.c
+++ b/src/joystick/hidapi/SDL_hidapi_stadia.c
@@ -152,7 +152,8 @@ HIDAPI_DriverStadia_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverStadia_C
 {
     Sint16 axis;
 
-    if (size < 11 || data[0] != 0x03) {
+	// The format is the same but the original FW will send 10 bytes and January '21 FW update will send 11
+    if (size < 10 || data[0] != 0x03) {
         /* We don't know how to handle this report */
         return;
     }