# HG changeset patch # User aurel # Date 1283081220 0 # Node ID 256b6b7d5e9641148403d40cc3a2a1d128ae60dd # Parent 77b4e83fe42dd8903b8a1822ff54edb24ffe5044 fix crash with un-commonly formated ASS files diff -r 77b4e83fe42d -r 256b6b7d5e96 subreader.c --- a/subreader.c Sun Aug 29 06:51:05 2010 +0000 +++ b/subreader.c Sun Aug 29 11:27:00 2010 +0000 @@ -641,19 +641,20 @@ 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 ++) {