alsa-mixer: check if mapping is NULL before using it

Fix Debian bullseye bug where adding this line makes pulseaudio crash on startup

`load-module module-alsa-sink device=hw:1,0 control=Wave`

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=989103

Fixes: dacfcbb09 ("alsa-ucm: use the proper mixer name for ucm pcm sink/source")
Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/576>
This commit is contained in:
Igor V. Kovalenko 2021-06-07 08:53:24 +03:00
parent 6d2a49a6a1
commit 79cb1369fc
2 changed files with 4 additions and 2 deletions

View file

@ -2113,7 +2113,8 @@ static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char
u->mixers = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func,
NULL, (pa_free_cb_t) pa_alsa_mixer_free);
mdev = pa_proplist_gets(mapping->proplist, "alsa.mixer_device");
if (mapping)
mdev = pa_proplist_gets(mapping->proplist, "alsa.mixer_device");
if (mdev) {
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, true);
} else {

View file

@ -1813,7 +1813,8 @@ static void find_mixer(struct userdata *u, pa_alsa_mapping *mapping, const char
u->mixers = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func,
NULL, (pa_free_cb_t) pa_alsa_mixer_free);
mdev = pa_proplist_gets(mapping->proplist, "alsa.mixer_device");
if (mapping)
mdev = pa_proplist_gets(mapping->proplist, "alsa.mixer_device");
if (mdev) {
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, false);
} else {