mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-01 22:58:47 -04: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.
This commit is contained in:
parent
0b5ab6be5a
commit
f12795330b
1 changed files with 3 additions and 2 deletions
|
|
@ -935,11 +935,12 @@ 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 (mdev == NULL || !(mixer_handle = pa_alsa_open_mixer_by_name(mixers, mdev, true))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue