# HG changeset patch # User reimar # Date 1251888936 0 # Node ID dc57d7bd98e108c240549b66fbcbfa0701f7d707 # Parent c990a2cbfa8d0551e470178cfbf76cdceda56764 Fix possible crashes with invalid SDPs that result in stream descriptions not being initialized. diff -r c990a2cbfa8d -r dc57d7bd98e1 stream/librtsp/rtsp_session.c --- 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)) { diff -r c990a2cbfa8d -r dc57d7bd98e1 stream/realrtsp/real.c --- a/stream/realrtsp/real.c Wed Sep 02 10:44:26 2009 +0000 +++ b/stream/realrtsp/real.c Wed Sep 02 10:55:36 2009 +0000 @@ -235,6 +235,8 @@ 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