summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2017-05-04 14:48:57 +0000
committerpfg <pfg@FreeBSD.org>2017-05-04 14:48:57 +0000
commitb131717707ec6a5c91da313be1bc42a2267e873b (patch)
tree8e6a248f276ec3ed036b5b74536f0f0f763d50c6 /sys
parente505b4e5e43aebae54f44fa61c5e86c35dd074d7 (diff)
downloadFreeBSD-src-b131717707ec6a5c91da313be1bc42a2267e873b.zip
FreeBSD-src-b131717707ec6a5c91da313be1bc42a2267e873b.tar.gz
MFC r317583:
Fix some cases where an index was used before its limits check. Obtained from: DragonFlyBSD (git 799ba435)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sound/pcm/feeder_matrix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/sound/pcm/feeder_matrix.c b/sys/dev/sound/pcm/feeder_matrix.c
index e59c124..5274ed4 100644
--- a/sys/dev/sound/pcm/feeder_matrix.c
+++ b/sys/dev/sound/pcm/feeder_matrix.c
@@ -750,8 +750,8 @@ feeder_matrix_oss_get_channel_order(struct pcmchan_matrix *m,
tmpmap = 0x0000000000000000ULL;
- for (i = 0; m->map[i].type != SND_CHN_T_MAX &&
- i < SND_CHN_OSS_MAX; i++) {
+ for (i = 0; i < SND_CHN_OSS_MAX && m->map[i].type != SND_CHN_T_MAX;
+ i++) {
if ((1 << m->map[i].type) & ~SND_CHN_OSS_VALIDMASK)
return (EINVAL);
tmpmap |=
OpenPOWER on IntegriCloud