Commit 23c26c5e authored by Petr Pisar's avatar Petr Pisar Committed by Moritz Grimm
Browse files

Check for undefined stream format

format element is mandatory but the server will crash if it does not
exist in the configuration file. This patch handle the case
gracefully.

It does not raise an error on unsupported value because documentation
allows it.

<https://bugzilla.redhat.com/show_bug.cgi?id=1244481

>
Signed-off-by: Petr Pisar's avatarPetr Písař <ppisar@redhat.com>
parent ee070099
......@@ -135,6 +135,11 @@ stream_setup(const char *host, unsigned short port, const char *mount)
return (NULL);
}
if (NULL == pezConfig->format) {
printf("%s: stream format is missing\n", __progname);
shout_free(shout);
return (NULL);
}
if (!strcmp(pezConfig->format, MP3_FORMAT) &&
shout_set_format(shout, SHOUT_FORMAT_MP3) != SHOUTERR_SUCCESS) {
printf("%s: shout_set_format(MP3): %s\n",
......
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