[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] 2 commits: alsa-ucm: disallow null mdev argument into pa_alsa_open_mixer_by_name()
Tanu Kaskinen
gitlab at gitlab.freedesktop.org
Mon Jul 6 09:52:38 UTC 2020
Tanu Kaskinen pushed to branch master at PulseAudio / pulseaudio
Commits:
0b5ab6be by Eero Nurkkala at 2020-07-06T12:47:19+03: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 at offcode.fi>
Signed-off-by: Eero Nurkkala <eero.nurkkala at offcode.fi>
- - - - -
f1279533 by Tanu Kaskinen at 2020-07-06T12:47:19+03:00
alsa-ucm: Fix NULL pointer handling
get_mixer_device() can return NULL when no mixer device is configured
for the device, so mdev2 can be NULL.
- - - - -
1 changed file:
- src/modules/alsa/alsa-ucm.c
Changes:
=====================================
src/modules/alsa/alsa-ucm.c
=====================================
@@ -935,14 +935,15 @@ static void probe_volumes(pa_hashmap *hash, bool is_sink, snd_pcm_t *pcm_handle,
mdev = NULL;
PA_DYNARRAY_FOREACH(dev, data->devices, idx) {
mdev2 = get_mixer_device(dev, is_sink);
- if (mdev && !pa_streq(mdev, mdev2)) {
+ if (mdev && mdev2 && !pa_streq(mdev, mdev2)) {
pa_log_error("Two mixer device names found ('%s', '%s'), using s/w volume", mdev, mdev2);
goto fail;
}
- mdev = mdev2;
+ if (mdev2)
+ 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;
}
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/6c58c69bb6b937c1e758410d3114fc3bc0606fbe...f12795330be2a3d6f12dd15680f3baf20f6f8f61
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/compare/6c58c69bb6b937c1e758410d3114fc3bc0606fbe...f12795330be2a3d6f12dd15680f3baf20f6f8f61
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/20200706/159edb57/attachment.htm>
More information about the pulseaudio-commits
mailing list