NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/52435: audio.c: mismatch of the maximum number of channels?



>Number:         52435
>Category:       kern
>Synopsis:       audio.c: mismatch of the maximum number of channels?
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 27 09:55:00 +0000 2017
>Originator:     Tetsuya Isaki
>Release:        NetBSD-current
>Organization:
NetBSD
>Environment:
source code review
>Description:
In audio.c, vchan_autoconfig() seems to search number of channels of
device by auto_config_channels[] array ( 32, 24, 16, 8, ... ).

On the other hand, audio_check_params() rejects number of channels > 12
(AUDIO_MAX_CHANNELS defined in sys/dev/audioi_if.h).

audio_check_params() is called from audiosetinfo() and
it is called from audio_set_vchan_default() and
it is called from vchan_autoconfig().

Is there no problem?


sys/dev/audio.c:
 450 int auto_config_precision[] = { 32, 16, 8 };
 451 int auto_config_channels[] = { 32, 24, 16, 8, 6, 4, 2, 1};
   :
4071 int
4072 audio_check_params(struct audio_params *p)
4073 {
   :
4139         /* sanity check # of channels*/
4140         if (p->channels < 1 || p->channels > AUDIO_MAX_CHANNELS)
4141                 return EINVAL;
4142
4143         return 0;
4144 }


>How-To-Repeat:
see source code.
>Fix:
N/A



Home | Main Index | Thread Index | Old Index