Commit 88f8b624 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Backport [20434]

parent 903827ba
...@@ -106,8 +106,8 @@ static int Open( vlc_object_t * p_this ) ...@@ -106,8 +106,8 @@ static int Open( vlc_object_t * p_this )
unsigned int i_size, i_extended; unsigned int i_size, i_extended;
char *psz_name; char *psz_name;
WAVEFORMATEXTENSIBLE *p_wf_ext; WAVEFORMATEXTENSIBLE *p_wf_ext = NULL;
WAVEFORMATEX *p_wf; WAVEFORMATEX *p_wf = NULL;
/* Is it a wav file ? */ /* Is it a wav file ? */
if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 ) return VLC_EGENERIC; if( stream_Peek( p_demux->s, &p_peek, 12 ) < 12 ) return VLC_EGENERIC;
...@@ -120,6 +120,9 @@ static int Open( vlc_object_t * p_this ) ...@@ -120,6 +120,9 @@ static int Open( vlc_object_t * p_this )
p_demux->pf_demux = Demux; p_demux->pf_demux = Demux;
p_demux->pf_control = Control; p_demux->pf_control = Control;
p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) );
if( p_sys == NULL )
return VLC_ENOMEM;
p_sys->p_es = NULL; p_sys->p_es = NULL;
p_sys->b_chan_reorder = 0; p_sys->b_chan_reorder = 0;
p_sys->i_channel_mask = 0; p_sys->i_channel_mask = 0;
...@@ -142,6 +145,9 @@ static int Open( vlc_object_t * p_this ) ...@@ -142,6 +145,9 @@ static int Open( vlc_object_t * p_this )
/* load waveformatex */ /* load waveformatex */
p_wf_ext = malloc( __EVEN( i_size ) + 2 ); p_wf_ext = malloc( __EVEN( i_size ) + 2 );
if( p_wf_ext == NULL )
goto error;
p_wf = (WAVEFORMATEX *)p_wf_ext; p_wf = (WAVEFORMATEX *)p_wf_ext;
p_wf->cbSize = 0; p_wf->cbSize = 0;
if( stream_Read( p_demux->s, if( stream_Read( p_demux->s,
...@@ -224,6 +230,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -224,6 +230,7 @@ static int Open( vlc_object_t * p_this )
p_sys->fmt.audio.i_bitspersample, p_sys->fmt.i_extra ); p_sys->fmt.audio.i_bitspersample, p_sys->fmt.i_extra );
free( p_wf ); free( p_wf );
p_wf = NULL;
switch( p_sys->fmt.i_codec ) switch( p_sys->fmt.i_codec )
{ {
...@@ -284,6 +291,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -284,6 +291,7 @@ static int Open( vlc_object_t * p_this )
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
free( p_wf );
relay: relay:
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment