summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2016-01-29 16:24:22 +0000
committerratchov <ratchov@openbsd.org>2016-01-29 16:24:22 +0000
commitc0c7b49c9cfe6e770230f4ebd463896af9ed8fa6 (patch)
treeb7a9e91c7b4908b7f3714a9611327f9b9f1eaab5
parentsort includes (diff)
downloadwireguard-openbsd-c0c7b49c9cfe6e770230f4ebd463896af9ed8fa6.tar.xz
wireguard-openbsd-c0c7b49c9cfe6e770230f4ebd463896af9ed8fa6.zip
Check that byte order is native only if we're using more than one
byte per sample, check that samples are lsb-aligned only if there's padding. Fixes unsupported parameters not being detected if compiled in 24-bit mode and sndiod is not running.
-rw-r--r--usr.bin/aucat/aucat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 1e3f1f560cc..eb91028a31b 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -622,8 +622,8 @@ dev_open(char *dev, int mode, int bufsz, char *port)
}
if (par.bits != ADATA_BITS ||
par.bps != sizeof(adata_t) ||
- par.le != SIO_LE_NATIVE ||
- (par.bps != SIO_BPS(par.bits) && par.msb)) {
+ (par.bps > 1 && par.le != SIO_LE_NATIVE) ||
+ (par.bps * 8 > par.bits && par.msb)) {
log_puts(dev_name);
log_puts(": unsupported audio params\n");
return 0;