mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04:00
alsa-ucm: disallow null mdev argument into pa_alsa_open_mixer_by_name()
It's possible for mdev to be NULL. In this case, an assert is taken in pa_alsa_open_mixer_by_name() with debug builds, and a crash with release builds. However, it's possible to bypass this trouble by taking the error path if mdev is NULL. Reported-by: Jarkko Sankala <jarkko.sankala@offcode.fi> Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
This commit is contained in:
parent
6c58c69bb6
commit
0b5ab6be5a
1 changed files with 1 additions and 1 deletions
|
|
@ -942,7 +942,7 @@ static void probe_volumes(pa_hashmap *hash, bool is_sink, snd_pcm_t *pcm_handle,
|
|||
mdev = mdev2;
|
||||
}
|
||||
|
||||
if (!(mixer_handle = pa_alsa_open_mixer_by_name(mixers, mdev, true))) {
|
||||
if (mdev == NULL || !(mixer_handle = pa_alsa_open_mixer_by_name(mixers, mdev, true))) {
|
||||
pa_log_error("Failed to find a working mixer device (%s).", mdev);
|
||||
goto fail;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue