From 8c8741fe2000d4b4d89a53f894363a42288cec3e Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Mon, 25 May 2015 01:00:38 +0300 Subject: 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. --- libass/ass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3