[Mplayer-cvslog] CVS: main subreader.c,1.39,1.40

Atmosfear atmos4 at mplayer.dev.hu
Mon Dec 10 15:48:04 CET 2001


Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv6251

Modified Files:
	subreader.c 
Log Message:
Patch by artur Zaprzala:
This patch adds test for NULL return value of strchr().


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- subreader.c	30 Nov 2001 23:45:48 -0000	1.39
+++ subreader.c	10 Dec 2001 14:48:02 -0000	1.40
@@ -273,8 +273,14 @@
  		p=line;	
  		// finds the body of the subtitle
  		for (i=0; i<3; i++){              
-                   p=strchr(p,':')+1;
-                 } 
+		   p=strchr(p,':');
+		   if (p==NULL) break;
+		   ++p;
+		} 
+		if (p==NULL) {
+		    printf("SUB: Skipping incorrect subtitle line!\n");
+		    continue;
+		}
  		i=0;
 
 		if (*p!='|') {




More information about the MPlayer-cvslog mailing list