[vlc-devel] commit: live555: fix use of uninitialized value ( partial and manual backport of ( Rémi Duraffort )

git version control git at videolan.org
Thu Sep 17 13:30:13 CEST 2009


vlc | branch: 1.0-bugfix | Rémi Duraffort <ivoire at videolan.org> | Thu Sep 17 13:28:58 2009 +0200| [7bf82d91fb20ec7e3d695789a9e31ae90ac38200] | committer: Rémi Duraffort 

live555: fix use of uninitialized value (partial and manual backport of
a30ec4a2f3afa762c4b19a1dc9e1259e12c03ef0)

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

 modules/demux/live555.cpp |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index 7cb2912..210636d 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -1237,7 +1237,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     demux_sys_t *p_sys = p_demux->p_sys;
     int64_t *pi64, i64;
     double  *pf, f;
-    bool *pb, *pb2, b_bool;
+    bool *pb, *pb2;
     int *pi_int;
 
     switch( i_query )
@@ -1402,8 +1402,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         case DEMUX_SET_PAUSE_STATE:
         {
-            int i;
-
             p_sys->b_paused = (bool)va_arg( args, int );
             if( p_sys->rtsp == NULL )
                 return VLC_EGENERIC;
@@ -1430,13 +1428,16 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             else if( !p_sys->b_paused && p_sys->p_timeout != NULL )
                 p_sys->p_timeout->b_handle_keep_alive = false;
 
-            for( i = 0; !b_bool && i < p_sys->i_track; i++ )
+            if( !p_sys->b_paused )
             {
-                live_track_t *tk = p_sys->track[i];
-                tk->b_rtcp_sync = false;
-                tk->i_pts = 0;
-                p_sys->i_pcr = 0;
-                es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
+                for( int i = 0; i < p_sys->i_track; i++ )
+                {
+                    live_track_t *tk = p_sys->track[i];
+                    tk->b_rtcp_sync = false;
+                    tk->i_pts = 0;
+                    p_sys->i_pcr = 0;
+                    es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
+                }
             }
 
             /* Reset data received counter */




More information about the vlc-devel mailing list