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
Differential D45876
sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO christos on Jul 5 2024, 2:23 PM. Authored by Tags None Referenced Files
Subscribers
Details If the channel list is empty, min_rate and min_channels will be INT_MAX. Sponsored by: The FreeBSD Foundation
Diff Detail
Event TimelineComment Actions @dev_submerge.ch I didn't add the same check in dsp_oss_engineinfo() because it will return EINVAL right away if no channel is found, and even if we find it, I don't think it's possible that caps->fmlist can be empty. |