input: fix use after free
authorTristan Matthews <le.businessman@gmail.com>
Fri, 1 Aug 2014 15:55:11 +0000 (11:55 -0400)
committerTristan Matthews <le.businessman@gmail.com>
Fri, 1 Aug 2014 15:55:11 +0000 (11:55 -0400)
src/input/input.c

index 87bbfe8..7f4693f 100644 (file)
@@ -2413,7 +2413,6 @@ static int InputSourceInit( input_thread_t *p_input,
 
         if( in->p_demux == NULL )
         {
-            stream_Delete( p_stream );
             if( vlc_object_alive( p_input ) )
             {
                 msg_Err( p_input, "no suitable demux module for `%s/%s://%s'",
@@ -2424,6 +2423,7 @@ static int InputSourceInit( input_thread_t *p_input,
                                   _("The format of '%s' cannot be detected. "
                                     "Have a look at the log for details."), psz_mrl );
             }
+            stream_Delete( p_stream );
             goto error;
         }
         assert( in->p_demux->pf_demux != NULL );