mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-28 05:40:23 -04:00
seq: add more checks to snd_seq_hw_set_client_info for older kernels
The snd_seq_set_client_midi_version() should fail for older kernel when applications are trying to configure new midi versions. BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4621 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
6855cb838d
commit
1b9a073e6a
1 changed files with 9 additions and 0 deletions
|
|
@ -125,6 +125,15 @@ static int snd_seq_hw_set_client_info(snd_seq_t *seq, snd_seq_client_info_t * in
|
|||
{
|
||||
snd_seq_hw_t *hw = seq->private_data;
|
||||
|
||||
/* added fields are not checked on older kernels */
|
||||
if (SNDRV_PROTOCOL_VERSION(1, 0, 3) > hw->version) {
|
||||
if (info->midi_version > 0)
|
||||
return -EINVAL;
|
||||
if (info->filter & SNDRV_SEQ_FILTER_NO_CONVERT)
|
||||
return -EINVAL;
|
||||
if (info->group_filter != 0)
|
||||
return -EINVAL;
|
||||
}
|
||||
if (ioctl(hw->fd, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, info) < 0) {
|
||||
/*SYSERR("SNDRV_SEQ_IOCTL_SET_CLIENT_INFO failed");*/
|
||||
return -errno;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue