[vlc-commits] mod: fix callback init order
Rémi Denis-Courmont
git at videolan.org
Thu May 3 18:57:47 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 3 19:50:58 2018 +0300| [fe975016cccfbb7135e0317bae905a828db07997] | committer: Rémi Denis-Courmont
mod: fix callback init order
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fe975016cccfbb7135e0317bae905a828db07997
---
modules/demux/mod.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/demux/mod.c b/modules/demux/mod.c
index 07a223d901..78bb787de0 100644
--- a/modules/demux/mod.c
+++ b/modules/demux/mod.c
@@ -159,10 +159,7 @@ static int Open( vlc_object_t *p_this )
if( i_size <= 0 || i_size >= MOD_MAX_FILE_SIZE )
return VLC_EGENERIC;
- /* Fill p_demux field */
- p_demux->pf_demux = Demux;
- p_demux->pf_control = Control;
- p_demux->p_sys = p_sys = malloc( sizeof( *p_sys ) );
+ p_sys = malloc( sizeof( *p_sys ) );
if( !p_sys )
return VLC_ENOMEM;
@@ -239,6 +236,10 @@ static int Open( vlc_object_t *p_this )
p_sys->fmt.audio.i_bitspersample = settings.mBits;
p_sys->es = es_out_Add( p_demux->out, &p_sys->fmt );
+ /* Fill p_demux field */
+ p_demux->pf_demux = Demux;
+ p_demux->pf_control = Control;
+ p_demux->p_sys = p_sys;
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list