HomeFreeBSD

sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO

Description

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

(cherry picked from commit 1a768ea9db3d66941b0dc5340ac028ef548808b8)

Details

Provenance
christosAuthored on Jul 6 2024, 6:23 PM
Reviewer
dev_submerge.ch
Differential Revision
D45876: sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO
Parents
rGecb0a2ed2f40: sound: Refactor sndstat_get_caps()
Branches
Unknown
Tags
Unknown