diff options
author | eyck <eyck@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-25 01:32:04 +0000 |
---|---|---|
committer | eyck <eyck@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2001-12-25 01:32:04 +0000 |
commit | 45ff92c257e966b986ea63561118360d4fe0458b (patch) | |
tree | c4d3330f028ffa28cce4cc40da87cf62ff2adcd6 /subreader.c | |
parent | 1844126fd7c56c23234bffd48b22ab7073fbb2e2 (diff) | |
download | mpv-45ff92c257e966b986ea63561118360d4fe0458b.tar.bz2 mpv-45ff92c257e966b986ea63561118360d4fe0458b.tar.xz |
vplayer format - no longer crashes on slightly broken subs.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3725 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r-- | subreader.c | 6 |
1 files 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); |