[Mplayer-cvslog] CVS: main asfheader.c,1.13,1.14

Bertrand Baudet bertrand at users.sourceforge.net
Sun May 20 15:24:43 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv32627

Modified Files:
	asfheader.c 
Log Message:
Fixed crashing while reading the content description for some ASF file.


Index: asfheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/asfheader.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** asfheader.c	2001/05/19 00:07:30	1.13
--- asfheader.c	2001/05/20 13:24:41	1.14
***************
*** 85,88 ****
--- 85,89 ----
  void pack_asf_string(char* string, int length) {
    int i,j;
+   if( string==NULL ) return;
    for( i=0, j=0; i<length && string[i]!='\0'; i+=2, j++) {
      string[j]=string[i];
***************
*** 218,240 ****
          stream_read(demuxer->stream,(char*) &contenth,sizeof(contenth));
          // extract the title
!         string=(char*)malloc(contenth.title_size);
!         stream_read(demuxer->stream, string, contenth.title_size);
!         print_asf_string("\n Title: ", string, contenth.title_size);
          // extract the author 
!         string=(char*)realloc((void*)string, contenth.author_size);
!         stream_read(demuxer->stream, string, contenth.author_size);
!         print_asf_string(" Author: ", string, contenth.author_size);
          // extract the copyright
!         string=(char*)realloc((void*)string, contenth.copyright_size);
!         stream_read(demuxer->stream, string, contenth.copyright_size);
!         print_asf_string(" Copyright: ", string, contenth.copyright_size);
          // extract the comment
!         string=(char*)realloc((void*)string, contenth.comment_size);
!         stream_read(demuxer->stream, string, contenth.comment_size);
!         print_asf_string(" Comment: ", string, contenth.comment_size);
          // extract the rating
!         string=(char*)realloc((void*)string, contenth.rating_size);
!         stream_read(demuxer->stream, string, contenth.rating_size);
!         print_asf_string(" Rating: ", string, contenth.rating_size);
  	printf("\n");
          free(string);
--- 219,251 ----
          stream_read(demuxer->stream,(char*) &contenth,sizeof(contenth));
          // extract the title
!         if( contenth.title_size!=0 ) {
!           string=(char*)malloc(contenth.title_size);
!           stream_read(demuxer->stream, string, contenth.title_size);
!           print_asf_string("\n Title: ", string, contenth.title_size);
!         }
          // extract the author 
!         if( contenth.author_size!=0 ) {
!           string=(char*)realloc((void*)string, contenth.author_size);
!           stream_read(demuxer->stream, string, contenth.author_size);
!           print_asf_string(" Author: ", string, contenth.author_size);
!         }
          // extract the copyright
!         if( contenth.copyright_size!=0 ) {
!           string=(char*)realloc((void*)string, contenth.copyright_size);
!           stream_read(demuxer->stream, string, contenth.copyright_size);
!           print_asf_string(" Copyright: ", string, contenth.copyright_size);
!         }
          // extract the comment
!         if( contenth.comment_size!=0 ) {
!           string=(char*)realloc((void*)string, contenth.comment_size);
!           stream_read(demuxer->stream, string, contenth.comment_size);
!           print_asf_string(" Comment: ", string, contenth.comment_size);
!         }
          // extract the rating
!         if( contenth.rating_size!=0 ) {
!           string=(char*)realloc((void*)string, contenth.rating_size);
!           stream_read(demuxer->stream, string, contenth.rating_size);
!           print_asf_string(" Rating: ", string, contenth.rating_size);
!         }
  	printf("\n");
          free(string);


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list