mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Fix incorrect use of enum that was leading to crashes on source connect for
unknown mimetype. svn path=/trunk/icecast/; revision=4344
This commit is contained in:
parent
5d88044bb7
commit
1644a6f718
@ -313,7 +313,7 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t
|
||||
|
||||
if (contenttype != NULL) {
|
||||
format_type_t format = format_get_type(contenttype);
|
||||
if (format < 0) {
|
||||
if (format == FORMAT_ERROR) {
|
||||
WARN1("Content-type \"%s\" not supported, dropping source", contenttype);
|
||||
goto fail;
|
||||
} else {
|
||||
|
@ -36,7 +36,7 @@ format_type_t format_get_type(char *contenttype)
|
||||
else if(strcmp(contenttype, "audio/mpeg") == 0)
|
||||
return FORMAT_TYPE_MP3;
|
||||
else
|
||||
return -1;
|
||||
return FORMAT_ERROR;
|
||||
}
|
||||
|
||||
char *format_get_mimetype(format_type_t type)
|
||||
|
@ -14,7 +14,8 @@ struct source_tag;
|
||||
typedef enum _format_type_tag
|
||||
{
|
||||
FORMAT_TYPE_VORBIS,
|
||||
FORMAT_TYPE_MP3
|
||||
FORMAT_TYPE_MP3,
|
||||
FORMAT_ERROR /* No format, source not processable */
|
||||
} format_type_t;
|
||||
|
||||
typedef struct _format_plugin_tag
|
||||
|
Loading…
Reference in New Issue
Block a user