[vlc-commits] demux: ts: fix pid loops boundary

Francois Cartegnie git at videolan.org
Fri Feb 20 19:57:14 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Feb 18 22:30:15 2015 +0100| [2b51d31e17fb0f8ca87381127f396fa7237b7edd] | committer: Francois Cartegnie

demux: ts: fix pid loops boundary

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

 modules/demux/ts.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index a467b56..dda6986 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -847,11 +847,11 @@ static void MissingPATPMTFixup( demux_t *p_demux )
     {
         /* Find a free one */
         for( i_program_pid = MIN_ES_PID;
-             i_program_pid < MAX_ES_PID && p_sys->pid[i_program_pid].b_seen;
+             i_program_pid <= MAX_ES_PID && p_sys->pid[i_program_pid].b_seen;
              i_program_pid++ );
     }
 
-    for( int i = MIN_ES_PID; i < MAX_ES_PID; i++ )
+    for( int i = MIN_ES_PID; i <= MAX_ES_PID; i++ )
     {
         if( !p_sys->pid[i].b_seen ||
             p_sys->pid[i].probed.i_type == -1 )
@@ -904,7 +904,7 @@ static void MissingPATPMTFixup( demux_t *p_demux )
     if( esstreams && mapped )
     {
         int j=0;
-        for( int i = MIN_ES_PID; i < MAX_ES_PID; i++ )
+        for( int i = MIN_ES_PID; i <= MAX_ES_PID; i++ )
         {
             if( !p_sys->pid[i].b_seen ||
                 p_sys->pid[i].probed.i_type == -1 )
@@ -4873,7 +4873,7 @@ static void AddAndCreateES( demux_t *p_demux, ts_pid_t *pid )
 
     if( b_create_delayed )
     {
-        for(int i=MIN_ES_PID; i<MAX_ES_PID; i++)
+        for(int i=MIN_ES_PID; i<=MAX_ES_PID; i++)
         {
             pid = &p_sys->pid[i];
             if(!pid->es || pid->es->id)



More information about the vlc-commits mailing list