diff options
author | aurel <aurel@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-08-29 11:27:00 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-02 04:15:49 +0200 |
commit | 343bdac280da20969a5d6a35bf23c64d2e82dcf2 (patch) | |
tree | 36967a2945e1d57ff0a120058437618a06102ca9 /subreader.c | |
parent | dec2db63261480933a17cdd8ffa4ec782e583a89 (diff) | |
download | mpv-343bdac280da20969a5d6a35bf23c64d2e82dcf2.tar.bz2 mpv-343bdac280da20969a5d6a35bf23c64d2e82dcf2.tar.xz |
subreader: fix crash with un-commonly formated ASS files
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32033 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'subreader.c')
-rw-r--r-- | subreader.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/subreader.c b/subreader.c index 6eb1b6d656..1f308cc659 100644 --- a/subreader.c +++ b/subreader.c @@ -567,19 +567,20 @@ static subtitle *sub_read_line_ssa(stream_t *st,subtitle *current, int utf16) { do { 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]", ¬hing, &hour1, &min1, &sec1, &hunsec1, &hour2, &min2, &sec2, &hunsec2, 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]", ¬hing, &hour1, &min1, &sec1, &hunsec1, &hour2, &min2, &sec2, &hunsec2, line3) < 9 ); line2=strchr(line3, ','); + if (!line2) return NULL; for (comma = 4; comma < max_comma; comma ++) { |