summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-06 19:20:16 +0000
committerrtognimp <rtognimp@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-07-06 19:20:16 +0000
commita27f05a6ea0e29754b150050b02a67b5e8fe80f3 (patch)
treec7c5692bc500e674c38cfcec610a9b1b1a6ed518 /libmpdemux
parent091cfd827a8534178134314e213067147bf791a3 (diff)
downloadmpv-a27f05a6ea0e29754b150050b02a67b5e8fe80f3.tar.bz2
mpv-a27f05a6ea0e29754b150050b02a67b5e8fe80f3.tar.xz
Do some sanity checks before writing stream information
Patch by Sergio Gelato >Sergio dot Gelato at astro dot su dot se< and some additions by me git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15931 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/realrtsp/sdpplin.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libmpdemux/realrtsp/sdpplin.c b/libmpdemux/realrtsp/sdpplin.c
index ff9246a9e7..ae0bee2b44 100644
--- a/libmpdemux/realrtsp/sdpplin.c
+++ b/libmpdemux/realrtsp/sdpplin.c
@@ -26,10 +26,12 @@
*
*/
+#include "config.h"
#include "rmff.h"
#include "rtsp.h"
#include "sdpplin.h"
#include "xbuffer.h"
+#include "mp_msg.h"
/*
#define LOG
@@ -251,7 +253,10 @@ sdpplin_t *sdpplin_parse(char *data) {
#ifdef LOG
printf("got data for stream id %u\n", stream->stream_id);
#endif
+ if (desc->stream && (stream->stream_id >= 0) && (stream->stream_id < desc->stream_count))
desc->stream[stream->stream_id]=stream;
+ else
+ mp_msg(MSGT_OPEN, MSGL_ERR, "sdpplin: got 'm=', but 'a=StreamCount' is still unknown. Broken sdp?\n");
continue;
}
@@ -284,7 +289,7 @@ sdpplin_t *sdpplin_parse(char *data) {
}
if(filter(data,"a=StreamCount:integer;",&buf)) {
- desc->stream_count=atoi(buf);
+ desc->stream_count=(unsigned int)atoi(buf);
desc->stream=malloc(sizeof(sdpplin_stream_t*)*desc->stream_count);
handled=1;
data=nl(data);