0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

subreader: fix crash with un-commonly formated ASS files

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32033 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
aurel 2010-08-29 11:27:00 +00:00 committed by Uoti Urpala
parent dec2db6326
commit 343bdac280

View File

@ -567,19 +567,20 @@ static subtitle *sub_read_line_ssa(stream_t *st,subtitle *current, int utf16) {
do { do {
if (!stream_read_line (st, line, LINE_LEN, utf16)) return NULL; if (!stream_read_line (st, line, LINE_LEN, utf16)) return NULL;
} while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d," } while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d"
"%[^\n\r]", &nothing, "%[^\n\r]", &nothing,
&hour1, &min1, &sec1, &hunsec1, &hour1, &min1, &sec1, &hunsec1,
&hour2, &min2, &sec2, &hunsec2, &hour2, &min2, &sec2, &hunsec2,
line3) < 9 line3) < 9
&& &&
sscanf (line, "Dialogue: %d,%d:%d:%d.%d,%d:%d:%d.%d," sscanf (line, "Dialogue: %d,%d:%d:%d.%d,%d:%d:%d.%d"
"%[^\n\r]", &nothing, "%[^\n\r]", &nothing,
&hour1, &min1, &sec1, &hunsec1, &hour1, &min1, &sec1, &hunsec1,
&hour2, &min2, &sec2, &hunsec2, &hour2, &min2, &sec2, &hunsec2,
line3) < 9 ); line3) < 9 );
line2=strchr(line3, ','); line2=strchr(line3, ',');
if (!line2) return NULL;
for (comma = 4; comma < max_comma; comma ++) for (comma = 4; comma < max_comma; comma ++)
{ {