mirror of https://github.com/ericonr/sndio.git
Fix integer multiplication overflow in block size calculation.
This commit is contained in:
parent
a1774cc9e0
commit
e6587d3b97
|
@ -278,7 +278,8 @@ slot_init(struct slot *s)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
s->bpf = s->afile.par.bps * (s->cmax - s->cmin + 1);
|
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 = s->round * (dev_bufsz / dev_round);
|
||||||
bufsz -= bufsz % s->round;
|
bufsz -= bufsz % s->round;
|
||||||
|
|
Loading…
Reference in New Issue