Mercurial > mplayer.hg
changeset 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 | a17d4f8040f1 |
files | stream/librtsp/rtsp_session.c stream/realrtsp/real.c |
diffstat | 2 files changed, 4 insertions(+), 1 deletions(-) [+] |
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)) {
--- 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