From efc963bb57c062fc341b9615f36e4e09c7e84a5b Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Fri, 10 May 2019 06:40:33 +0200 Subject: [PATCH 1/3] Use the correct length for MIDI common messages. --- sndiod/midi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sndiod/midi.c b/sndiod/midi.c index b5cc4e8..51e921c 100644 --- a/sndiod/midi.c +++ b/sndiod/midi.c @@ -309,7 +309,8 @@ midi_in(struct midi *iep, unsigned char *idata, int icount) iep->idx = 0; } else if (c >= 0xf0) { iep->msg[0] = c; - iep->len = common_len[c & 7]; + iep->len = common_len[c >> 5]; + log_puti(iep->len); iep->st = c; iep->idx = 1; } else if (c >= 0x80) { From a1774cc9e065a0007e5be1bb113a8060254e3317 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Fri, 10 May 2019 07:00:52 +0200 Subject: [PATCH 2/3] Revert "Use the correct length for MIDI common messages." --- sndiod/midi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sndiod/midi.c b/sndiod/midi.c index 51e921c..b5cc4e8 100644 --- a/sndiod/midi.c +++ b/sndiod/midi.c @@ -309,8 +309,7 @@ midi_in(struct midi *iep, unsigned char *idata, int icount) iep->idx = 0; } else if (c >= 0xf0) { iep->msg[0] = c; - iep->len = common_len[c >> 5]; - log_puti(iep->len); + iep->len = common_len[c & 7]; iep->st = c; iep->idx = 1; } else if (c >= 0x80) { From e6587d3b977e684b192d2709edf485ba1b38a27b Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Fri, 17 May 2019 07:25:16 +0200 Subject: [PATCH 3/3] 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;