From dec1c85932adf4e7c0054a5c5a8ef6fb7f791e1e Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Tue, 8 Jan 2019 17:01:21 +0100 Subject: [PATCH] demux: wav: fix uninitialized member usage (cid #1476075) --- modules/demux/wav.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/demux/wav.c b/modules/demux/wav.c index c01e7fd3c6..3a6933357a 100644 --- a/modules/demux/wav.c +++ b/modules/demux/wav.c @@ -411,6 +411,11 @@ static int Open( vlc_object_t * p_this ) msg_Err( p_demux, "cannot find 'data' chunk" ); goto error; } + + if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 ) + goto error; + p_sys->i_data_pos = vlc_stream_Tell( p_demux->s ); + if( !b_is_rf64 || i_size < UINT32_MAX ) { int64_t i_stream_size = stream_Size( p_demux->s ); @@ -418,10 +423,6 @@ static int Open( vlc_object_t * p_this ) p_sys->i_data_size = i_size; } - if( vlc_stream_Read( p_demux->s, NULL, 8 ) != 8 ) - goto error; - p_sys->i_data_pos = vlc_stream_Tell( p_demux->s ); - if( p_sys->fmt.i_bitrate <= 0 ) { p_sys->fmt.i_bitrate = (int64_t)p_sys->i_frame_size * -- 2.11.4.GIT