mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	resample: limit input and output offsets
Clamp the offsets to the max input and output sizes or we might end up with invalid len and crash. See #1994
This commit is contained in:
		
							parent
							
								
									dc4cf163ef
								
							
						
					
					
						commit
						113ab31613
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -878,6 +878,11 @@ static int impl_node_process(void *object)
 | 
			
		|||
	src_datas = alloca(sizeof(void*) * this->resample.channels);
 | 
			
		||||
	dst_datas = alloca(sizeof(void*) * this->resample.channels);
 | 
			
		||||
 | 
			
		||||
	if (inport->offset > size)
 | 
			
		||||
		inport->offset = size;
 | 
			
		||||
	if (outport->offset > maxsize)
 | 
			
		||||
		outport->offset = maxsize;
 | 
			
		||||
 | 
			
		||||
	if (size == 0) {
 | 
			
		||||
		size = MAX_SAMPLES * sizeof(float);
 | 
			
		||||
		for (i = 0; i < sb->n_datas; i++)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue