NetBSD Problem Report #16652
Received: (qmail 20522 invoked from network); 4 May 2002 01:59:04 -0000
Message-Id: <20020504015907.2215C1112F@www.netbsd.org>
Date: Fri, 3 May 2002 18:59:07 -0700 (PDT)
From: svs@ropnet.ru
Sender: nobody@netbsd.org
Reply-To: svs@ropnet.ru
To: gnats-bugs@gnats.netbsd.org
Subject: uaudio(4) mixer values can wrap around from 255 to 0.
X-Send-Pr-Version: www-1.0
>Number: 16652
>Category: kern
>Synopsis: uaudio(4) mixer values can wrap around from 255 to 0.
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat May 04 02:00:00 +0000 2002
>Closed-Date: Tue Oct 28 17:17:37 +0000 2003
>Last-Modified: Tue Oct 28 17:17:37 +0000 2003
>Originator: Sergey Svishchev
>Release: 1.5ZC
>Organization:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
Index: sys/dev/usb/uaudio.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/usb/uaudio.c,v
retrieving revision 1.56
diff -u -r1.56 uaudio.c
--- uaudio.c 2002/03/23 17:17:11 1.56
+++ uaudio.c 2002/04/29 22:21:26
@@ -1654,9 +1654,14 @@
mc->type, val, mc->minval, mc->maxval));
if (mc->type == MIX_ON_OFF)
val = (val != 0);
- else
+ else {
val = ((uaudio_signext(mc->type, val) - mc->minval) * 256
+ mc->mul/2) / mc->mul;
+ if (val < 0)
+ val = 0;
+ if (val > 255)
+ val = 255;
+ }
DPRINTFN(5, ("val'=%d\n", val));
return (val);
}
>Release-Note:
>Audit-Trail:
From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: pr/16652 CVS commit: src/sys/dev/usb
Date: Tue, 14 Oct 2003 13:12:19 +0000 (UTC)
Module Name: src
Committed By: wiz
Date: Tue Oct 14 13:12:19 UTC 2003
Modified Files:
src/sys/dev/usb: uaudio.c
Log Message:
Fix mixer wraparound. Closes PR 16652.
Patch from Sergey Svishchev. mycroft says "looks ok".
To generate a diff of this commit:
cvs rdiff -r1.68 -r1.69 src/sys/dev/usb/uaudio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: wiz
State-Changed-When: Tue Oct 28 17:17:19 UTC 2003
State-Changed-Why:
Fixed, thanks!
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.