summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2013-02-26 22:52:08 +0000
committerratchov <ratchov@openbsd.org>2013-02-26 22:52:08 +0000
commit7abc294a8288e2a4d13d8593b5c53b86ac84a41c (patch)
tree2fd4cbf733595ed68fae97352f044ef40c2bc6ea
parentDon't try to purge one-time rules from the main ruleset. (diff)
downloadwireguard-openbsd-7abc294a8288e2a4d13d8593b5c53b86ac84a41c.tar.xz
wireguard-openbsd-7abc294a8288e2a4d13d8593b5c53b86ac84a41c.zip
Encoding conversion buffer size is one stream block, not one device
block. Fix crashes occuring when the client sample frequency is much larger than the device sample frequency. Found by Alexander Polakov, thanks. ok deraadt@
-rw-r--r--usr.bin/sndiod/dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c
index d41d6909149..c7243b5093e 100644
--- a/usr.bin/sndiod/dev.c
+++ b/usr.bin/sndiod/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.3 2012/11/30 20:44:31 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.4 2013/02/26 22:52:08 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -1689,7 +1689,7 @@ slot_attach(struct slot *s)
if (!aparams_native(&s->par)) {
dec_init(&s->mix.dec, &s->par, slot_nch);
s->mix.decbuf =
- xmalloc(d->round * slot_nch * sizeof(adata_t));
+ xmalloc(s->round * slot_nch * sizeof(adata_t));
}
if (s->rate != d->rate) {
resamp_init(&s->mix.resamp, s->round, d->round,
@@ -1728,7 +1728,7 @@ slot_attach(struct slot *s)
if (!aparams_native(&s->par)) {
enc_init(&s->sub.enc, &s->par, slot_nch);
s->sub.encbuf =
- xmalloc(d->round * slot_nch * sizeof(adata_t));
+ xmalloc(s->round * slot_nch * sizeof(adata_t));
}
/*