diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2015-05-25 01:00:38 +0300 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2015-06-09 00:17:48 +0300 |
commit | 8c8741fe2000d4b4d89a53f894363a42288cec3e (patch) | |
tree | 162510f80c360551642389b1c060dd8e241eb6d1 | |
parent | e0bde0b0625f2d398489d9e2f6b9578c11b8c6fb (diff) | |
download | libass-8c8741fe2000d4b4d89a53f894363a42288cec3e.tar.bz2 libass-8c8741fe2000d4b4d89a53f894363a42288cec3e.tar.xz |
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.
-rw-r--r-- | libass/ass.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |