output_all: check param!=NULL before accessing it
When printing the error message, MPD dereferences the NULL pointer to print an error message if no audio_output section is present.
This commit is contained in:
parent
f35432af5a
commit
18cb4fa277
@ -113,8 +113,13 @@ audio_output_all_init(void)
|
|||||||
/* only allow param to be NULL if there just one audioOutput */
|
/* only allow param to be NULL if there just one audioOutput */
|
||||||
assert(param || (num_audio_outputs == 1));
|
assert(param || (num_audio_outputs == 1));
|
||||||
|
|
||||||
if (!audio_output_init(output, param, &error))
|
if (!audio_output_init(output, param, &error)) {
|
||||||
g_error("line %i: %s", param->line, error->message);
|
if (param != NULL)
|
||||||
|
g_error("line %i: %s",
|
||||||
|
param->line, error->message);
|
||||||
|
else
|
||||||
|
g_error("%s", error->message);
|
||||||
|
}
|
||||||
|
|
||||||
/* require output names to be unique: */
|
/* require output names to be unique: */
|
||||||
for (j = 0; j < i; j++) {
|
for (j = 0; j < i; j++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user