mirror of
https://gitlab.xiph.org/xiph/ezstream.git
synced 2025-02-02 15:07:45 -05:00
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 Písař <ppisar@redhat.com>
This commit is contained in:
parent
ee0700992e
commit
23c26c5e01
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user