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@offcode.fi>
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
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;
}