[vlc-commits] demux: mp4: fix uninitialized vars on failure handling

Francois Cartegnie git at videolan.org
Wed Oct 14 17:15:53 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct 14 17:15:13 2015 +0200| [0456bcdc30d01bc2918f62a413dd4f472a94dee1] | committer: Francois Cartegnie

demux: mp4: fix uninitialized vars on failure handling

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

 modules/demux/mp4/mp4.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 67128ba..bd95209 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -1064,6 +1064,9 @@ static int Demux( demux_t *p_demux )
         }
     }
 
+    uint32_t i_nb_samples = 0;
+    uint32_t i_samplessize = 0;
+
     if ( !tk )
     {
         msg_Dbg( p_demux, "Could not select track by data position" );
@@ -1086,8 +1089,7 @@ static int Demux( demux_t *p_demux )
              MP4_GetMoviePTS( p_sys ), i_candidate_pos );
 #endif
 
-    uint32_t i_nb_samples = 0;
-    uint32_t i_samplessize = MP4_TrackGetReadSize( tk, &i_nb_samples );
+    i_samplessize = MP4_TrackGetReadSize( tk, &i_nb_samples );
     if( i_samplessize > 0 )
     {
         block_t *p_block;



More information about the vlc-commits mailing list