From: Oleg Oshmyan Date: Sun, 24 May 2015 22:00:38 +0000 (+0300) Subject: string2timecode: don't truncate to int X-Git-Tag: 0.12.3~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c8741fe2000d4b4d89a53f894363a42288cec3e;p=libass string2timecode: don't truncate to int The timecode is a long long, but it is computed as a product whose all multiplicands are (unsigned) ints and so effectively has the value of an (unsigned) int. Fix this, and use the full long long range, by explicitly making one of the first two multiplicands a long long. Found by Coverity Scan. --- diff --git a/libass/ass.c b/libass/ass.c index 69dec8d..01dd2eb 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -188,7 +188,7 @@ static long long string2timecode(ASS_Library *library, char *p) ass_msg(library, MSGL_WARN, "Bad timestamp"); return 0; } - tm = ((h * 60 + m) * 60 + s) * 1000 + ms * 10; + tm = ((h * 60LL + m) * 60 + s) * 1000 + ms * 10; return tm; }