summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/aucat.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-07-20 10:20:54 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-07-20 10:20:54 +0000
commit4b7849eb6fa12b6a257a681b78ed16ed8ad7df1a (patch)
tree56790a6387790a2bfa4981cd6c3a1f46fcd9f0b3 /usr.bin/aucat/aucat.c
parentd662ba131db62cabe229d20f1eb9b5103df6bb93 (diff)
Fix integer overflow that would causes >12 hours files
to not properly relocate. Found with coverity.
Diffstat (limited to 'usr.bin/aucat/aucat.c')
-rw-r--r--usr.bin/aucat/aucat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 9780a408075..d2da7ae82a5 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -831,11 +831,11 @@ dev_mmcloc(int hr, int min, int sec, int fr, int cent, int fps)
{
long long pos;
- pos = dev_rate * hr * 3600 +
- dev_rate * min * 60 +
- dev_rate * sec +
- dev_rate * fr / fps +
- dev_rate * cent / (100 * fps);
+ pos = (long long)dev_rate * hr * 3600 +
+ (long long)dev_rate * min * 60 +
+ (long long)dev_rate * sec +
+ (long long)dev_rate * fr / fps +
+ (long long)dev_rate * cent / (100 * fps);
if (dev_pos == pos)
return;
dev_pos = pos;