mirror of
https://github.com/mpv-player/mpv
synced 2025-03-03 12:47:49 +00:00
sub_read_line_ssa sig11 fix by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
when this function encounters a multiline subtitle with more lines than SUB_MAX_TEXT, this stupid bug manifests. The function actually reads one line less than the returned count. Subsequently, either during iconv or during playing a null pointer gets referenced, with obvious result. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6248 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
3bd1f1e505
commit
e8235b8140
@ -396,7 +396,7 @@ subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) {
|
||||
line2 ++;
|
||||
line2 ++;
|
||||
|
||||
current->lines=1;num=0;
|
||||
current->lines=0;num=0;
|
||||
current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1;
|
||||
current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2;
|
||||
|
||||
@ -410,8 +410,8 @@ subtitle *sub_read_line_ssa(FILE *fd,subtitle *current) {
|
||||
if (current->lines >= SUB_MAX_TEXT) return current;
|
||||
}
|
||||
|
||||
|
||||
current->text[num]=strdup(line2);
|
||||
current->lines++;
|
||||
|
||||
return current;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user