1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-23 23:32:26 +00:00

no more garbage! (fixed by laaz)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@271 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
gabucino 2001-04-01 19:35:18 +00:00
parent 348e865399
commit b4535b0069

View File

@ -61,9 +61,9 @@ subtitle *sub_read_line_microdvd(FILE *fd,subtitle *current) {
next=p, i=0;
while ((next =sub_readtext (next, &(current->text[i])))) {
if (current->text[i]==ERR || current->text[i]==ERR) {return ERR;}
if (current->text[i]==ERR) {return ERR;}
i++;
if (i>SUB_MAX_TEXT) { printf ("Too many lines in a subtitle\n");return ERR;}
if (i>SUB_MAX_TEXT) { printf ("Too many lines in a subtitle\n");current->lines=i;return;}
}
current->lines=i+1;
@ -92,6 +92,7 @@ subtitle *sub_read_line_subrip(FILE *fd, subtitle *current) {
current->text[current->lines-1]=(char *)malloc (len+1);
if (!current->text[current->lines-1]) return ERR;
strncpy (current->text[current->lines-1], q, len);
current->text[current->lines-1][len]='\0';
if (!*p || *p=='\r' || *p=='\n') break;
while (*p++!=']');
}
@ -120,7 +121,7 @@ subtitle *sub_read_line_third(FILE *fd,subtitle *current) {
if (len) {
current->text[i]=(char *)malloc (len+1);
if (!current->text[i]) return ERR;
strncpy (current->text[i], line, len);
strncpy (current->text[i], line, len); current->text[i][len]='\0';
i++;
} else {
break;