Commit 591633b7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

m3u8: validate UTF-8 input

parent 2548031a
......@@ -55,6 +55,11 @@ static char *GuessEncoding (const char *str)
return IsUTF8 (str) ? strdup (str) : FromLatin1 (str);
}
static char *CheckUnicode (const char *str)
{
return IsUTF8 (str) ? strdup (str): NULL;
}
/*****************************************************************************
* Import_M3U: main import function
*****************************************************************************/
......@@ -68,7 +73,7 @@ int Import_M3U( vlc_object_t *p_this )
if( POKE( p_peek, "RTSPtext", 8 ) /* QuickTime */
|| demux_IsPathExtension( p_demux, ".m3u8" )
|| demux_IsForced( p_demux, "m3u8" ) )
pf_dup = strdup; /* UTF-8 */
pf_dup = CheckUnicode; /* UTF-8 */
else
if( POKE( p_peek, "#EXTM3U", 7 )
|| demux_IsPathExtension( p_demux, ".m3u" )
......
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