mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	channelmix: guard against invalid channels
This commit is contained in:
		
							parent
							
								
									cc463da63e
								
							
						
					
					
						commit
						da95043002
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -549,6 +549,10 @@ int channelmix_init(struct channelmix *mix)
 | 
			
		|||
{
 | 
			
		||||
	const struct channelmix_info *info;
 | 
			
		||||
 | 
			
		||||
	if (mix->src_chan > SPA_AUDIO_MAX_CHANNELS ||
 | 
			
		||||
	    mix->dst_chan > SPA_AUDIO_MAX_CHANNELS)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
	info = find_channelmix_info(mix->src_chan, mix->src_mask, mix->dst_chan, mix->dst_mask,
 | 
			
		||||
			mix->cpu_flags);
 | 
			
		||||
	if (info == NULL)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,8 +43,6 @@
 | 
			
		|||
#define MASK_5_1	_M(FL)|_M(FR)|_M(FC)|_M(LFE)|_M(SL)|_M(SR)|_M(RL)|_M(RR)
 | 
			
		||||
#define MASK_7_1	_M(FL)|_M(FR)|_M(FC)|_M(LFE)|_M(SL)|_M(SR)|_M(RL)|_M(RR)
 | 
			
		||||
 | 
			
		||||
#define BUFFER_SIZE 4096
 | 
			
		||||
 | 
			
		||||
#define BUFFER_SIZE 4096
 | 
			
		||||
#define MAX_TAPS 255
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue