From: wm4 Date: Fri, 6 Mar 2015 12:28:48 +0000 (+0100) Subject: Make timestamp parsing more lenient X-Git-Tag: 0.12.2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9beeecc2d1676eeb663ffd8706fe33cbf5eb2069;p=libass Make timestamp parsing more lenient Fixes "[ARR] Musashi no Ken - 01 [AVC][5697986B].ssa", which has timestamps like "00:02:30.85". It starts with 2 zeros instead of one, which probably means it's an invalid file, but it's accepted by various other parsers (VSFilter, MPlayer, vlc, ffmpeg). --- diff --git a/libass/ass.c b/libass/ass.c index 04ce895..594cca3 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -183,7 +183,7 @@ static long long string2timecode(ASS_Library *library, char *p) { unsigned h, m, s, ms; long long tm; - int res = sscanf(p, "%1d:%2d:%2d.%2d", &h, &m, &s, &ms); + int res = sscanf(p, "%d:%d:%d.%d", &h, &m, &s, &ms); if (res < 4) { ass_msg(library, MSGL_WARN, "Bad timestamp"); return 0;