Commit b12b5130 authored by Max Kellermann's avatar Max Kellermann

mixer: check param==NULL in the alsa and oss mixer code

When MPD starts without audio output configuration, the "param" variable is NULL. This triggers a segmentation fault in both mixer plugins.
parent b533307d
......@@ -49,6 +49,9 @@ alsa_mixer_configure(struct mixer_data *data, ConfigParam *param)
struct alsa_mixer *am = (struct alsa_mixer *)data;
BlockParam *bp;
if (param == NULL)
return;
if ((bp = getBlockParam(param, "mixer_device"))) {
if (am->device)
g_free(am->device);
......
......@@ -52,6 +52,10 @@ oss_mixer_configure(struct mixer_data *data, ConfigParam *param)
{
struct oss_mixer *om = (struct oss_mixer *) data;
BlockParam *bp;
if (param == NULL)
return;
bp = getBlockParam(param, "mixer_device");
if (bp) {
if (om->device)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment