mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-27 08:00:11 +00:00
sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO
If the channel list is empty, min_rate and min_channels will be INT_MAX. Instead, assign them to 0, like we do in sndstat_get_caps(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45876
This commit is contained in:
parent
9d8b93bc9c
commit
1a768ea9db
@ -2182,6 +2182,10 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex)
|
||||
|
||||
CHN_UNLOCK(ch);
|
||||
}
|
||||
if (ai->min_rate == INT_MAX)
|
||||
ai->min_rate = 0;
|
||||
if (ai->min_channels == INT_MAX)
|
||||
ai->min_channels = 0;
|
||||
|
||||
PCM_UNLOCK(d);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user