diff options
author | 2020-12-10 17:30:49 +0000 | |
---|---|---|
committer | 2020-12-10 17:30:49 +0000 | |
commit | 91f869588eef1efd21641f4dd8be5088fa96f4db (patch) | |
tree | e3e15d292df4e58f56bb9815108704a6e1f57b60 | |
parent | update to nsd 4.3.4 (diff) | |
download | wireguard-openbsd-91f869588eef1efd21641f4dd8be5088fa96f4db.tar.xz wireguard-openbsd-91f869588eef1efd21641f4dd8be5088fa96f4db.zip |
Check sample signedness when setting up format conversions.
Fixes confusion between s16 and u16 found in aucat by James Cook.
-rw-r--r-- | usr.bin/sndiod/dsp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/sndiod/dsp.c b/usr.bin/sndiod/dsp.c index a2998d2c579..0f0c21afc86 100644 --- a/usr.bin/sndiod/dsp.c +++ b/usr.bin/sndiod/dsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsp.c,v 1.14 2018/09/18 06:05:45 miko Exp $ */ +/* $OpenBSD: dsp.c,v 1.15 2020/12/10 17:30:49 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -192,7 +192,9 @@ aparams_log(struct aparams *par) int aparams_native(struct aparams *par) { - return par->bps == sizeof(adata_t) && par->bits == ADATA_BITS && + return par->sig && + par->bps == sizeof(adata_t) && + par->bits == ADATA_BITS && (par->bps == 1 || par->le == ADATA_LE) && (par->bits == par->bps * 8 || !par->msb); } |