From e6587d3b977e684b192d2709edf485ba1b38a27b Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Fri, 17 May 2019 07:25:16 +0200 Subject: [PATCH] Fix integer multiplication overflow in block size calculation. --- aucat/aucat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aucat/aucat.c b/aucat/aucat.c index 68293af..af8a761 100644 --- a/aucat/aucat.c +++ b/aucat/aucat.c @@ -278,7 +278,8 @@ slot_init(struct slot *s) } #endif s->bpf = s->afile.par.bps * (s->cmax - s->cmin + 1); - s->round = (dev_round * s->afile.rate + dev_rate - 1) / dev_rate; + s->round = ((long long)dev_round * s->afile.rate + + dev_rate - 1) / dev_rate; bufsz = s->round * (dev_bufsz / dev_round); bufsz -= bufsz % s->round;