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

m3u8: validate UTF-8 input

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