[MPlayer-cvslog] r29626 - in trunk/stream: librtsp/rtsp_session.c realrtsp/real.c

reimar subversion at mplayerhq.hu
Wed Sep 2 12:55:36 CEST 2009


Author: reimar
Date: Wed Sep  2 12:55:36 2009
New Revision: 29626

Log:
Fix possible crashes with invalid SDPs that result in stream descriptions
not being initialized.

Modified:
   trunk/stream/librtsp/rtsp_session.c
   trunk/stream/realrtsp/real.c

Modified: trunk/stream/librtsp/rtsp_session.c
==============================================================================
--- trunk/stream/librtsp/rtsp_session.c	Wed Sep  2 12:44:26 2009	(r29625)
+++ trunk/stream/librtsp/rtsp_session.c	Wed Sep  2 12:55:36 2009	(r29626)
@@ -139,7 +139,8 @@ rtsp_session_t *rtsp_session_start(int f
     /* we are talking to a real server ... */
 
     rmff_header_t *h=real_setup_and_get_header(rtsp_session->s, bandwidth, user, pass);
-    if (!h) {
+    if (!h || !h->streams[0]) {
+      rmff_free_header(h);
       /* got an redirect? */
       if (rtsp_search_answers(rtsp_session->s, RTSP_OPTIONS_LOCATION))
       {

Modified: trunk/stream/realrtsp/real.c
==============================================================================
--- trunk/stream/realrtsp/real.c	Wed Sep  2 12:44:26 2009	(r29625)
+++ trunk/stream/realrtsp/real.c	Wed Sep  2 12:55:36 2009	(r29626)
@@ -235,6 +235,8 @@ static rmff_header_t *real_parse_sdp(cha
     char b[64];
     int rulematches[MAX_RULEMATCHES];
 
+    if (!desc->stream[i])
+      continue;
 #ifdef LOG
     printf("calling asmrp_match with:\n%s\n%u\n", desc->stream[i]->asm_rule_book, bandwidth);
 #endif


More information about the MPlayer-cvslog mailing list