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

Francois Cartegnie git at videolan.org
Wed Jan 9 12:16:32 CET 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jan  8 17:01:21 2019 +0100| [575102bf0eab799f45833e676b2cbfd955e7dd5a] | committer: Hugo Beauzée-Luyssen

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

(cherry picked from commit dec1c85932adf4e7c0054a5c5a8ef6fb7f791e1e)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 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 9f5e8a9fa8..fd1a3b4325 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