mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
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:
parent
6d2a49a6a1
commit
79cb1369fc
2 changed files with 4 additions and 2 deletions
|
|
@ -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,
|
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);
|
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) {
|
if (mdev) {
|
||||||
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, true);
|
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, true);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -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,
|
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);
|
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) {
|
if (mdev) {
|
||||||
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, false);
|
u->mixer_handle = pa_alsa_open_mixer_by_name(u->mixers, mdev, false);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue