mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
pcm: route: Correctly close slave pcm when no matching chmap is found
This patch fixes a bug where the slave pcm was not correctly closed on some error conditions, such as not finding a matching chmap. Reported-by: Raymond Yau <superquad.vortex2@gmail.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
80a43f23db
commit
84f8b976c0
1 changed files with 3 additions and 1 deletions
|
|
@ -1429,8 +1429,10 @@ int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (tt_chmap) {
|
||||
err = find_matching_chmap(spcm, tt_chmap, &chmap, &schannels);
|
||||
free(tt_chmap);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
snd_pcm_close(spcm);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
err = _snd_pcm_route_determine_ttable(tt, &csize, &ssize, chmap);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue