1
0
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:
Michael Smith 2003-02-14 10:31:21 +00:00
parent 5d88044bb7
commit 1644a6f718
3 changed files with 4 additions and 3 deletions

View File

@ -313,7 +313,7 @@ int connection_create_source(client_t *client, connection_t *con, http_parser_t
if (contenttype != NULL) { if (contenttype != NULL) {
format_type_t format = format_get_type(contenttype); format_type_t format = format_get_type(contenttype);
if (format < 0) { if (format == FORMAT_ERROR) {
WARN1("Content-type \"%s\" not supported, dropping source", contenttype); WARN1("Content-type \"%s\" not supported, dropping source", contenttype);
goto fail; goto fail;
} else { } else {

View File

@ -36,7 +36,7 @@ format_type_t format_get_type(char *contenttype)
else if(strcmp(contenttype, "audio/mpeg") == 0) else if(strcmp(contenttype, "audio/mpeg") == 0)
return FORMAT_TYPE_MP3; return FORMAT_TYPE_MP3;
else else
return -1; return FORMAT_ERROR;
} }
char *format_get_mimetype(format_type_t type) char *format_get_mimetype(format_type_t type)

View File

@ -14,7 +14,8 @@ struct source_tag;
typedef enum _format_type_tag typedef enum _format_type_tag
{ {
FORMAT_TYPE_VORBIS, FORMAT_TYPE_VORBIS,
FORMAT_TYPE_MP3 FORMAT_TYPE_MP3,
FORMAT_ERROR /* No format, source not processable */
} format_type_t; } format_type_t;
typedef struct _format_plugin_tag typedef struct _format_plugin_tag