mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Add some more format checks
The format parse functions don't really check if the parsed values make any sense so we need to to this ourselves.
This commit is contained in:
		
							parent
							
								
									c30d743198
								
							
						
					
					
						commit
						74447acedb
					
				
					 24 changed files with 182 additions and 59 deletions
				
			
		| 
						 | 
				
			
			@ -375,6 +375,10 @@ static void capture_param_changed(void *data, uint32_t id, const struct spa_pod
 | 
			
		|||
			return;
 | 
			
		||||
		if (spa_format_audio_raw_parse(param, &info) < 0)
 | 
			
		||||
			return;
 | 
			
		||||
		if (info.rate == 0 ||
 | 
			
		||||
		    info.channels == 0 ||
 | 
			
		||||
		    info.channels > SPA_AUDIO_MAX_CHANNELS)
 | 
			
		||||
			return;
 | 
			
		||||
 | 
			
		||||
		impl->capture_info = info;
 | 
			
		||||
		recalculate_buffer(impl);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue