diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-05-08 04:11:32 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-05-08 04:11:32 +0000 |
commit | bd4d8b906fbec0d1cc4ce459a21b1f9ccf21557b (patch) | |
tree | 4ae72041797fe689be3dedac2dd02e06ffc776b1 /sys/dev/pci/azalia.h | |
parent | b30b2046edf6b7efa6e243944c8fb3706d01ec73 (diff) |
Don't crash when a connection list has invalid NIDs.
From NetBSD
Diffstat (limited to 'sys/dev/pci/azalia.h')
-rw-r--r-- | sys/dev/pci/azalia.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/pci/azalia.h b/sys/dev/pci/azalia.h index 9051a67c46b..e5344c42980 100644 --- a/sys/dev/pci/azalia.h +++ b/sys/dev/pci/azalia.h @@ -1,4 +1,4 @@ -/* $OpenBSD: azalia.h,v 1.3 2006/05/08 03:53:57 brad Exp $ */ +/* $OpenBSD: azalia.h,v 1.4 2006/05/08 04:11:31 brad Exp $ */ /* $NetBSD: azalia.h,v 1.3 2005/09/29 04:14:03 kent Exp $ */ /*- @@ -508,6 +508,10 @@ typedef struct { #define MI_TARGET_VOLUME 0x106 } mixer_item_t; +#define VALID_WIDGET_NID(nid, codec) (nid == (codec)->audiofunc || \ + (nid >= (codec)->wstart && \ + nid < (codec)->wend)) + typedef struct { int nconv; nid_t conv[HDA_MAX_CHANNELS]; |