mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
[ALSA-LIB] dmix: dont forget to return -EINVAL on errors
snd_pcm_dmix_open() returns success if the open fails attempting to open not the HW plugin (dmix seems to be limited to use only the HW plugin right now). This leads to memory corruptions and eventually a SIGSEGV. The attached patch fixes the omission. Signed-off-by: Stas Sergeev <stsp@aknet.ru>
This commit is contained in:
parent
8a42294dc4
commit
6f515096d9
1 changed files with 1 additions and 0 deletions
|
|
@ -871,6 +871,7 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
|
||||||
|
|
||||||
if (snd_pcm_type(spcm) != SND_PCM_TYPE_HW) {
|
if (snd_pcm_type(spcm) != SND_PCM_TYPE_HW) {
|
||||||
SNDERR("dmix plugin can be only connected to hw plugin");
|
SNDERR("dmix plugin can be only connected to hw plugin");
|
||||||
|
ret = -EINVAL;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue