[MPlayer-cvslog] CVS: main/libmpdemux/realrtsp sdpplin.c,1.3,1.4

Roberto Togni CVS syncmail at mplayerhq.hu
Wed Jul 6 21:20:19 CEST 2005


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main/libmpdemux/realrtsp
In directory mail:/var2/tmp/cvs-serv16224

Modified Files:
	sdpplin.c 
Log Message:

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


Index: sdpplin.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/sdpplin.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sdpplin.c	22 Jun 2005 11:58:56 -0000	1.3
+++ sdpplin.c	6 Jul 2005 19:20:16 -0000	1.4
@@ -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 @@
 #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 @@
     }
     
     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);




More information about the MPlayer-cvslog mailing list