[MPlayer-dev-eng] [PATCH] fix segfaults on invalid rtsp streams when using live.com

adland adland123 at yahoo.com
Thu Mar 18 04:35:21 CET 2004


Patch to remove the sig 11 segfaults on failure of live.com rtsp stream setup.
(live.com is enabled in build)

example of invalid rtsp stream URL is 
rtsp://203.167.246.115/trackID=1

Failed to get a SDP description from URL "rtsp://203.167.246.115/trackID=1":
cannot handle DESCRIBE response: RTSP/1.0 404 Not Found

it is a small change and is listed below.
tested changes and they worked.

apply

diff -Naur main.orig/libmpdemux/demux_rtp.cpp updated/libmpdemux/demux_rtp.cpp
--- main.orig/libmpdemux/demux_rtp.cpp  2004-03-02 03:52:59.000000000 -0500
+++ updated/libmpdemux/demux_rtp.cpp    2004-03-17 17:20:37.000000000 -0500
@@ -146,7 +146,7 @@
     if (rtspClient == NULL) {
       fprintf(stderr, "Failed to create RTSP client: %s\n",
        env->getResultMsg());
-      break;
+           return NULL; //FAILURE so let it be known and propagated back
     }
     sdpDescription = openURL_rtsp(rtspClient, url);
       } else { // SIP
@@ -156,7 +156,7 @@
     if (sipClient == NULL) {
       fprintf(stderr, "Failed to create SIP client: %s\n",
        env->getResultMsg());
-      break;
+         return NULL; //FAILURE so let it be known and propagated back
     }
     sipClient->setClientStartPortNum(8000);
     sdpDescription = openURL_sip(sipClient, url);
@@ -165,13 +165,13 @@
       if (sdpDescription == NULL) {
     fprintf(stderr, "Failed to get a SDP description from URL \"%s\": %s\n",
      url, env->getResultMsg());
-    break;
+     return NULL; //FAILURE so let it be known and propagated back
       }
     }

     // Now that we have a SDP description, create a MediaSession from it:
     MediaSession* mediaSession = MediaSession::createNew(*env, sdpDescription);
-    if (mediaSession == NULL) break;
+    if (mediaSession == NULL)  return NULL; //FAILURE so let it be known and
propagated back


     // Create a 'RTPState' structure containing the state that we just created,





More information about the MPlayer-dev-eng mailing list