From ce68b58c02a2fcdf8de4f0da70bb6cfd133b5657 Mon Sep 17 00:00:00 2001 From: Pavlov Konstantin Date: Fri, 11 Jan 2008 22:56:58 +0000 Subject: [PATCH] Fix another problem in realrtsp (ported from xine-lib upstream): * Fix invalid memory access in Real Media SDP with tailored stream; reported by Roland Kay. [bug #1602631] CVS patchset: 8442 CVS date: 2006/12/25 16:21:56 --- modules/access/rtsp/real_sdpplin.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/access/rtsp/real_sdpplin.c b/modules/access/rtsp/real_sdpplin.c index d262d986e1..0afc5a414e 100644 --- a/modules/access/rtsp/real_sdpplin.c +++ b/modules/access/rtsp/real_sdpplin.c @@ -233,16 +233,23 @@ sdpplin_t *sdpplin_parse(char *data) { free( desc ); return NULL; } + + desc->stream = NULL; + memset(desc, 0, sizeof(sdpplin_t)); while (data && *data) { handled=0; if (filter(data, "m=", &buf)) { - stream=sdpplin_parse_stream(&data); - lprintf("got data for stream id %u\n", stream->stream_id); - desc->stream[stream->stream_id]=stream; - continue; + if ( !desc->stream ) { + fprintf(stderr, "sdpplin.c: stream identifier found before stream count, skipping."); + continue; + } + stream=sdpplin_parse_stream(&data); + lprintf("got data for stream id %u\n", stream->stream_id); + desc->stream[stream->stream_id]=stream; + continue; } if(filter(data,"a=Title:buffer;",&buf)) { decoded=b64_decode(buf, decoded, &len); -- 2.39.2