mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-17 14:47:19 +01:00
Fixed bug 4525 - Fix crash in ALSA_HotplugThread caused by bad return value check
Anthony Pesch Fix snd_device_name_hint return value check According to the ALSA documentation, snd_device_name_hint returns 0 on success, otherwise a negative error code. The code previously only considered -1 to be an error, which let other error codes through resulting in a segfault when hints (which was NULL) was dereferenced
This commit is contained in:
parent
55f18d3625
commit
35255342cd
@ -788,7 +788,7 @@ ALSA_HotplugThread(void *arg)
|
|||||||
ALSA_Device *seen;
|
ALSA_Device *seen;
|
||||||
ALSA_Device *prev;
|
ALSA_Device *prev;
|
||||||
|
|
||||||
if (ALSA_snd_device_name_hint(-1, "pcm", &hints) != -1) {
|
if (ALSA_snd_device_name_hint(-1, "pcm", &hints) == 0) {
|
||||||
int i, j;
|
int i, j;
|
||||||
const char *match = NULL;
|
const char *match = NULL;
|
||||||
int bestmatch = 0xFFFF;
|
int bestmatch = 0xFFFF;
|
||||||
|
Loading…
Reference in New Issue
Block a user