]> git.sesse.net Git - vlc/commitdiff
* modules/stream_out/mosaic_bridge.c: Avoid accessing a deallocated object.
authorChristophe Massiot <massiot@videolan.org>
Tue, 7 Jun 2005 16:39:00 +0000 (16:39 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 7 Jun 2005 16:39:00 +0000 (16:39 +0000)
modules/stream_out/mosaic_bridge.c

index b9ac4c474a5fc256bdb1f3252ed1a4f0803d73b3..91e76970cca71b933ae0403478635d70e6c9be6d 100644 (file)
@@ -192,11 +192,6 @@ static int Open( vlc_object_t *p_this )
         p_sys->i_sar_num = p_sys->i_sar_den = 1;
     }
 
-    if ( p_sys->i_height || p_sys->i_width )
-    {
-        p_sys->p_image = image_HandlerCreate( p_stream );
-    }
-
     p_stream->pf_add    = Add;
     p_stream->pf_del    = Del;
     p_stream->pf_send   = Send;
@@ -308,6 +303,11 @@ static sout_stream_id_t * Add( sout_stream_t *p_stream, es_format_t *p_fmt )
 
     vlc_mutex_unlock( p_sys->p_lock );
 
+    if ( p_sys->i_height || p_sys->i_width )
+    {
+        p_sys->p_image = image_HandlerCreate( p_stream );
+    }
+
     msg_Dbg( p_stream, "mosaic bridge id=%s pos=%d", p_es->psz_id, i );
 
     return (sout_stream_id_t *)p_sys;