[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] alsa-mixer: check if mapping is NULL before using it

PulseAudio Marge Bot (@pulseaudio-merge-bot) gitlab at gitlab.freedesktop.org
Mon Jun 7 14:33:33 UTC 2021



PulseAudio Marge Bot pushed to branch master at PulseAudio / pulseaudio


Commits:
79cb1369 by Igor V. Kovalenko at 2021-06-07T12:13:49+03: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>

- - - - -


2 changed files:

- src/modules/alsa/alsa-sink.c
- src/modules/alsa/alsa-source.c


Changes:

=====================================
src/modules/alsa/alsa-sink.c
=====================================
@@ -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 {


=====================================
src/modules/alsa/alsa-source.c
=====================================
@@ -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 {



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/79cb1369fc4d22966cb65253e9da2ccda2f25b45

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/79cb1369fc4d22966cb65253e9da2ccda2f25b45
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20210607/f831aa0f/attachment.htm>


More information about the pulseaudio-commits mailing list