File: Fix-crash-when-enumerating-Steam-Controllers.patch

package info (click to toggle)
libsdl3 3.2.22%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 43,172 kB
  • sloc: ansic: 390,638; objc: 12,337; xml: 9,084; cpp: 5,728; perl: 4,589; python: 3,372; sh: 1,032; makefile: 265; cs: 56
file content (26 lines) | stat: -rw-r--r-- 877 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Sam Lantinga <slouken@libsdl.org>
Date: Thu, 14 Aug 2025 14:49:04 -0700
Subject: Fix crash when enumerating Steam Controllers

Bug: https://github.com/libsdl-org/SDL/pull/13746
Origin: upstream, 3.2.24, commit:a6fd74fa3bdee9b718e213cec35dfb0193ef9f2a
---
 src/joystick/hidapi/SDL_hidapi_steam.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/joystick/hidapi/SDL_hidapi_steam.c b/src/joystick/hidapi/SDL_hidapi_steam.c
index b48d353..6b36651 100644
--- a/src/joystick/hidapi/SDL_hidapi_steam.c
+++ b/src/joystick/hidapi/SDL_hidapi_steam.c
@@ -1038,6 +1038,11 @@ static bool HIDAPI_DriverSteam_IsSupportedDevice(SDL_HIDAPI_Device *device, cons
         return false;
     }
 
+    if (!device) {
+        // Might be supported by this driver, enumerate and find out
+        return true;
+    }
+
     if (device->is_bluetooth) {
         return true;
     }