Wow, this is clearly wrong (found in esa_set_params):

if (p->channels < 1 && p->channels > 2)
		return EINVAL;
Change the 'and' to an 'or' so the check actually does something.
This commit is contained in:
jmcneill 2005-10-29 17:44:34 +00:00
parent 2b6672222b
commit 4b8daa06de
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: esa.c,v 1.29 2005/06/28 00:28:42 thorpej Exp $ */
/* $NetBSD: esa.c,v 1.30 2005/10/29 17:44:34 jmcneill Exp $ */
/*
* Copyright (c) 2001, 2002 Jared D. McNeill <jmcneill@invisible.ca>
@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.29 2005/06/28 00:28:42 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.30 2005/10/29 17:44:34 jmcneill Exp $");
#include <sys/types.h>
#include <sys/errno.h>
@ -279,7 +279,7 @@ esa_set_params(void *hdl, int setmode, int usemode,
if (p->sample_rate < ESA_MINRATE ||
p->sample_rate > ESA_MAXRATE ||
(p->precision != 8 && p->precision != 16) ||
(p->channels < 1 && p->channels > 2))
(p->channels < 1 || p->channels > 2))
return EINVAL;
i = auconv_set_converter(esa_formats, ESA_NFORMATS,