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

Francois Cartegnie git at videolan.org
Thu Nov 10 14:54:04 CET 2016


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 10 14:52:52 2016 +0100| [6ab6b75910e9bb4d8895ab96510f6f94df2774fe] | committer: Francois Cartegnie

demux: mp4: fix uninitialized vars on failure handling

cherry-picked from 0456bcdc30d01bc2918f62a413dd4f472a94dee1

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 968d301..e9d0023 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -875,6 +875,8 @@ 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" );
@@ -897,8 +899,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