Commit ff4fd93f4c0cc016c3d84b713f0c4aed09ca64c0

Sam Lantinga 2023-07-14T10:01:04

Fixed getting the CRC of virtual joysticks without a VID/PID (cherry picked from commit b40fb5c51e2a5350ba00fbf4db86b4ae1066db92) (cherry picked from commit 6089b35706171b950f55a010bc9df2114cd7a783)

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 12965f9..3818cab 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -1906,7 +1906,7 @@ void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *prod
         if (crc16) {
             *crc16 = SDL_SwapLE16(guid16[1]);
         }
-    } else if (bus < ' ') {
+    } else if (bus < ' ' || bus == SDL_HARDWARE_BUS_VIRTUAL) {
         /* This GUID fits the unknown VID/PID form:
          * 16-bit bus
          * 16-bit CRC16 of the joystick name (can be zero)