mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Fixed SIGSEGV based on thinkos
This commit is contained in:
		
							parent
							
								
									25ad23d202
								
							
						
					
					
						commit
						735e5473e0
					
				
					 1 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -437,7 +437,7 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
 | 
			
		|||
{
 | 
			
		||||
	snd_config_iterator_t i, next;
 | 
			
		||||
	int err;
 | 
			
		||||
	snd_pcm_t *spcm;
 | 
			
		||||
	snd_pcm_t *rpcm = NULL, *spcm;
 | 
			
		||||
	snd_config_t *slave = NULL, *sconf;
 | 
			
		||||
	snd_config_t *hooks = NULL;
 | 
			
		||||
	snd_config_for_each(i, next, conf) {
 | 
			
		||||
| 
						 | 
				
			
			@ -471,7 +471,7 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
 | 
			
		|||
	snd_config_delete(sconf);
 | 
			
		||||
	if (err < 0)
 | 
			
		||||
		return err;
 | 
			
		||||
	err = snd_pcm_hooks_open(pcmp, name, spcm, 1);
 | 
			
		||||
	err = snd_pcm_hooks_open(&rpcm, name, spcm, 1);
 | 
			
		||||
	if (err < 0) {
 | 
			
		||||
		snd_pcm_close(spcm);
 | 
			
		||||
		return err;
 | 
			
		||||
| 
						 | 
				
			
			@ -486,16 +486,17 @@ int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name,
 | 
			
		|||
			if (err < 0) {
 | 
			
		||||
				SNDERR("unknown pcm_hook %s", str);
 | 
			
		||||
			} else {
 | 
			
		||||
				err = snd_pcm_hook_add_conf(*pcmp, root, n);
 | 
			
		||||
				err = snd_pcm_hook_add_conf(rpcm, root, n);
 | 
			
		||||
				snd_config_delete(n);
 | 
			
		||||
			}
 | 
			
		||||
		} else
 | 
			
		||||
			err = snd_pcm_hook_add_conf(*pcmp, root, n);
 | 
			
		||||
			err = snd_pcm_hook_add_conf(rpcm, root, n);
 | 
			
		||||
		if (err < 0) {
 | 
			
		||||
			snd_pcm_close(*pcmp);
 | 
			
		||||
			snd_pcm_close(rpcm);
 | 
			
		||||
			return err;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	*pcmp = rpcm;
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue