Fix infinite parse of recursive definitions

Fixed the infinite parse (and eventually segfault) of recursive definitions.
Also fixed the parse of a string slave PCM of direct plugins.
This commit is contained in:
Takashi Iwai 2006-01-30 14:41:51 +00:00
parent bf174b7046
commit eccc92a34d
29 changed files with 127 additions and 36 deletions

View file

@ -847,7 +847,10 @@ int snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
dmix->sync_ptr = snd_pcm_dmix_sync_ptr;
if (first_instance) {
ret = snd_pcm_open_slave(&spcm, root, sconf, stream, mode | SND_PCM_NONBLOCK);
/* recursion is already checked in
snd_pcm_direct_get_slave_ipc_offset() */
ret = snd_pcm_open_slave(&spcm, root, sconf, stream,
mode | SND_PCM_NONBLOCK, NULL);
if (ret < 0) {
SNDERR("unable to open slave");
goto _err;
@ -1124,7 +1127,7 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
params.period_size = psize;
params.buffer_size = bsize;
ipc_offset = snd_pcm_direct_get_slave_ipc_offset(sconf, stream);
ipc_offset = snd_pcm_direct_get_slave_ipc_offset(root, sconf, stream);
if (ipc_offset < 0) {
snd_config_delete(sconf);
return ipc_offset;