[vlc-commits] demux: wav: fix uninitialized member usage (cid #1476075)

Francois Cartegnie git at videolan.org
Tue Jan 8 18:07:41 CET 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan  8 17:01:21 2019 +0100| [dec1c85932adf4e7c0054a5c5a8ef6fb7f791e1e] | committer: Francois Cartegnie

demux: wav: fix uninitialized member usage (cid #1476075)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dec1c85932adf4e7c0054a5c5a8ef6fb7f791e1e
---

 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 *



More information about the vlc-commits mailing list