diff options
author | Max Kellermann <max@duempel.org> | 2009-01-16 16:00:12 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-16 17:11:18 +0100 |
commit | b12b5130c99603f22534aba31615386b5fc40817 (patch) | |
tree | 7caaed3c17795d51d8e45bba7f1e8da03873e633 /src/mixer/alsa_mixer.c | |
parent | b533307d6f0fd4bf775ae24fea9d89e178eec2fc (diff) | |
download | mpd-b12b5130c99603f22534aba31615386b5fc40817.tar.gz mpd-b12b5130c99603f22534aba31615386b5fc40817.tar.xz mpd-b12b5130c99603f22534aba31615386b5fc40817.zip |
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.
Diffstat (limited to 'src/mixer/alsa_mixer.c')
-rw-r--r-- | src/mixer/alsa_mixer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mixer/alsa_mixer.c b/src/mixer/alsa_mixer.c index 86a9ae86e..201cb6f20 100644 --- a/src/mixer/alsa_mixer.c +++ b/src/mixer/alsa_mixer.c @@ -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); |