diff stream/librtsp/rtsp_session.c @ 29584:dc57d7bd98e1

Fix possible crashes with invalid SDPs that result in stream descriptions not being initialized.
author reimar
date Wed, 02 Sep 2009 10:55:36 +0000
parents c990a2cbfa8d
children 629b30951662
line wrap: on
line diff
--- a/stream/librtsp/rtsp_session.c	Wed Sep 02 10:44:26 2009 +0000
+++ b/stream/librtsp/rtsp_session.c	Wed Sep 02 10:55:36 2009 +0000
@@ -139,7 +139,8 @@
     /* 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))
       {