summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-08 10:01:44 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-11-08 10:01:44 +0000
commitdb4b8b2a0f9c2ddb369ec47cb36774c8e0490e68 (patch)
tree3e126ecfeddad5b59186b9fdaff7e791c945d85b /usr.bin
parent76c3c67b2b914c70b220b243f8ce55b59c9b08b1 (diff)
when dev_attach()ing play-only or record-only streams, don't
use both play and record parameters (one of them might be NULL, causing aucat to segfault).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/aucat/dev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/aucat/dev.c b/usr.bin/aucat/dev.c
index 91df14b062b..931c6378719 100644
--- a/usr.bin/aucat/dev.c
+++ b/usr.bin/aucat/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.11 2008/11/07 21:01:15 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.12 2008/11/08 10:01:43 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -382,11 +382,12 @@ dev_attach(char *name,
struct abuf *obuf, struct aparams *sopar, unsigned overrun)
{
struct abuf *pbuf = NULL, *rbuf = NULL;
- struct aparams ipar = *sipar, opar = *sopar;
+ struct aparams ipar, opar;
struct aproc *conv;
unsigned nfr;
if (ibuf) {
+ ipar = *sipar;
pbuf = LIST_FIRST(&dev_mix->obuflist);
if (!aparams_eqenc(&ipar, &dev_opar)) {
nfr = (dev_bufsz + 3) / 4 + dev_round - 1;
@@ -425,6 +426,7 @@ dev_attach(char *name,
ibuf->xrun = underrun;
}
if (obuf) {
+ opar = *sopar;
rbuf = LIST_FIRST(&dev_sub->ibuflist);
if (!aparams_eqenc(&opar, &dev_ipar)) {
nfr = (dev_bufsz + 3) / 4 + dev_round - 1;