[vlc-commits] rtsp: fix for loop

Pierre Ynard git at videolan.org
Mon Mar 14 01:19:22 CET 2011


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Mar 14 01:18:33 2011 +0100| [79621a9155eb7e3fc4c946365eecc7f6f4536784] | committer: Pierre Ynard

rtsp: fix for loop

This fixes a crash with VoD when all tracks were not set up

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

 modules/stream_out/rtsp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index 99e1f88..8ec90f7 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -442,7 +442,7 @@ int RtspTrackAttach( rtsp_stream_t *rtsp, const char *name,
         goto out;
 
     rtsp_strack_t *tr = NULL;
-    for (int i = 0; session->trackc; i++)
+    for (int i = 0; i < session->trackc; i++)
     {
         if (session->trackv[i].id == id)
         {
@@ -500,7 +500,7 @@ void RtspTrackDetach( rtsp_stream_t *rtsp, const char *name,
     if (session == NULL)
         goto out;
 
-    for (int i = 0; session->trackc; i++)
+    for (int i = 0; i < session->trackc; i++)
     {
         rtsp_strack_t *tr = session->trackv + i;
         if (tr->sout_id == sout_id)



More information about the vlc-commits mailing list