From 45ff92c257e966b986ea63561118360d4fe0458b Mon Sep 17 00:00:00 2001 From: eyck Date: Tue, 25 Dec 2001 01:32:04 +0000 Subject: vplayer format - no longer crashes on slightly broken subs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3725 b3059339-0415-0410-9bf9-f77b7e298cf2 --- subreader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subreader.c b/subreader.c index 4f3b6e436d..67d72f83d9 100644 --- a/subreader.c +++ b/subreader.c @@ -253,17 +253,17 @@ subtitle *sub_read_line_vplayer(FILE *fd,subtitle *current) { 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); -- cgit v1.2.3