Commit cd5c762f authored by Francois Cartegnie's avatar Francois Cartegnie

playlist: m3u: fix CheckContentType check.

strncase cmp reports 0 if the tested size is 0.
Was always matching empty Content-Type then.
parent e917fdc8
...@@ -133,7 +133,14 @@ static bool CheckContentType( stream_t * p_stream, const char * psz_ctype ) ...@@ -133,7 +133,14 @@ static bool CheckContentType( stream_t * p_stream, const char * psz_ctype )
char *psz_check = stream_ContentType( p_stream ); char *psz_check = stream_ContentType( p_stream );
if( !psz_check ) return false; if( !psz_check ) return false;
int i_res = strncasecmp( psz_check, psz_ctype, strlen( psz_check ) ); int i_len = strlen( psz_check );
if ( i_len == 0 )
{
free( psz_check );
return false;
}
int i_res = strncasecmp( psz_check, psz_ctype, i_len );
free( psz_check ); free( psz_check );
return ( i_res == 0 ) ? true : false; return ( i_res == 0 ) ? true : false;
......
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