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:
parent
b533307d6f
commit
b12b5130c9
@ -49,6 +49,9 @@ alsa_mixer_configure(struct mixer_data *data, ConfigParam *param)
|
|||||||
struct alsa_mixer *am = (struct alsa_mixer *)data;
|
struct alsa_mixer *am = (struct alsa_mixer *)data;
|
||||||
BlockParam *bp;
|
BlockParam *bp;
|
||||||
|
|
||||||
|
if (param == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if ((bp = getBlockParam(param, "mixer_device"))) {
|
if ((bp = getBlockParam(param, "mixer_device"))) {
|
||||||
if (am->device)
|
if (am->device)
|
||||||
g_free(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;
|
struct oss_mixer *om = (struct oss_mixer *) data;
|
||||||
BlockParam *bp;
|
BlockParam *bp;
|
||||||
|
|
||||||
|
if (param == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
bp = getBlockParam(param, "mixer_device");
|
bp = getBlockParam(param, "mixer_device");
|
||||||
if (bp) {
|
if (bp) {
|
||||||
if (om->device)
|
if (om->device)
|
||||||
|
Loading…
Reference in New Issue
Block a user