]> git.sesse.net Git - vlc/commitdiff
PS: assign demux callbacks after possible fail
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 20 Jul 2014 19:37:40 +0000 (21:37 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 20 Jul 2014 19:37:40 +0000 (21:37 +0200)
modules/demux/ps.c

index 361d529b710e6797f8998a729b3652c836b49927..4126a9724e522faec6789e998fd4677d2ab0a2da 100644 (file)
@@ -127,11 +127,12 @@ static int OpenCommon( vlc_object_t *p_this, bool b_force )
     }
 
     /* Fill p_demux field */
-    p_demux->pf_demux = Demux;
-    p_demux->pf_control = Control;
     p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
     if( !p_sys ) return VLC_ENOMEM;
 
+    p_demux->pf_demux = Demux;
+    p_demux->pf_control = Control;
+
     /* Init p_sys */
     p_sys->i_mux_rate = 0;
     p_sys->i_scr      = -1;