]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/pls.c
m3u8: validate UTF-8 input
[vlc] / modules / demux / playlist / pls.c
index ac5d99a5b4d50e1c96621b46404fe0ea5ae09304..f809ebe5048ffaa81caff179333bfecaa92ebc9c 100644 (file)
@@ -142,12 +142,12 @@ static int Demux( demux_t *p_demux )
             /* we found a new item, insert the previous */
             if( psz_mrl )
             {
-                p_input = input_item_New( p_demux, psz_mrl, psz_name );
+                p_input = input_item_New( psz_mrl, psz_name );
                 input_item_CopyOptions( p_current_input, p_input );
                 input_item_node_AppendItem( p_subitems, p_input );
                 vlc_gc_decref( p_input );
                 free( psz_mrl_orig );
-                psz_mrl_orig = NULL;
+                psz_mrl_orig = psz_mrl = NULL;
             }
             else
             {
@@ -169,12 +169,7 @@ static int Demux( demux_t *p_demux )
             if( !strncasecmp( psz_key, "Ref", sizeof("Ref") -1 ) )
             {
                 if( !strncasecmp( psz_mrl, "http://", sizeof("http://") -1 ) )
-                {
-                    psz_mrl++;
-                    psz_mrl[0] = 'm';
-                    psz_mrl[1] = 'm';
-                    psz_mrl[2] = 's';
-                }
+                    memcpy( psz_mrl, "mmsh", 4 );
             }
         }
         else if( !strncasecmp( psz_key, "title", sizeof("title") -1 ) )
@@ -199,12 +194,11 @@ static int Demux( demux_t *p_demux )
     /* Add last object */
     if( psz_mrl )
     {
-        p_input = input_item_New( p_demux, psz_mrl, psz_name );
+        p_input = input_item_New( psz_mrl, psz_name );
         input_item_CopyOptions( p_current_input, p_input );
         input_item_node_AppendItem( p_subitems, p_input );
         vlc_gc_decref( p_input );
         free( psz_mrl_orig );
-        psz_mrl = NULL;
     }
     else
     {