avformat/mpegts: fix iteration count in add_pid_to_pmt()
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Nov 2014 18:31:59 +0000 (19:31 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Nov 2014 18:31:59 +0000 (19:31 +0100)
Fixes accessing uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mpegts.c

index 97e07a7..78aa13e 100644 (file)
@@ -306,7 +306,7 @@ static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid,
     if (p->nb_pids >= MAX_PIDS_PER_PROGRAM)
         return;
 
-    for (i = 0; i < MAX_PIDS_PER_PROGRAM; i++)
+    for (i = 0; i < p->nb_pids; i++)
         if (p->pids[i] == pid)
             return;