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.
This commit is contained in:
Max Kellermann 2009-01-16 16:00:12 +01:00
parent b533307d6f
commit b12b5130c9
2 changed files with 7 additions and 0 deletions

View File

@ -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);

View File

@ -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)