[Mplayer-cvslog] CVS: main subreader.c,1.42,1.43

Dariush Pietrzak eyck at mplayer.dev.hu
Tue Dec 25 02:32:06 CET 2001


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

Modified Files:
	subreader.c 
Log Message:
vplayer format - no longer crashes on slightly broken subs.


Index: subreader.c
===================================================================
RCS file: /cvsroot/mplayer/main/subreader.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- subreader.c	24 Dec 2001 10:39:28 -0000	1.42
+++ subreader.c	25 Dec 2001 01:32:04 -0000	1.43
@@ -253,17 +253,17 @@
 	char line[LINE_LEN+1];
 	char line2[LINE_LEN+1];
 	int a1,a2,a3,b1,b2,b3;
-	char *p=NULL, *next;
+	char *p=NULL, *next,*separator;
 	int i,len,len2,plen;
 
 	memset(current, '\0', sizeof(subtitle));
 
 	while (!current->text[0]) {
 		if (!fgets (line, LINE_LEN, fd)) return NULL;
-		if ((len=sscanf (line, "%d:%d:%d:%n",&a1,&a2,&a3,&plen)) < 3)
+		if ((len=sscanf (line, "%d:%d:%d%c%n",&a1,&a2,&a3,&separator,&plen)) < 4)
 			continue;
 		if (!fgets (line2, LINE_LEN, fd)) return NULL;
-		if ((len2=sscanf (line2, "%d:%d:%d:",&b1,&b2,&b3)) < 3)
+		if ((len2=sscanf (line2, "%d:%d:%d%c",&b1,&b2,&b3,&separator)) < 3)
 			continue;
 		// przewiñ o linijkê do ty³u:
 		fseek(fd,-strlen(line2),SEEK_CUR);




More information about the MPlayer-cvslog mailing list