mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	filter-graph: fix index off by one in dsp_delay_c
Checking w + 1 > n_buffer means that w will go to n_buffer, which in turn leads to reading buffer[2 * n_buffer].
This commit is contained in:
		
							parent
							
								
									c3ec30dec7
								
							
						
					
					
						commit
						5aa46bbddd
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -217,7 +217,7 @@ void dsp_delay_c(void *obj, float *buffer, uint32_t *pos, uint32_t n_buffer,
 | 
			
		|||
		for (i = 0; i < n_samples; i++) {
 | 
			
		||||
			buffer[w] = buffer[w + n_buffer] = src[i];
 | 
			
		||||
			dst[i] = buffer[w + o];
 | 
			
		||||
			w = w + 1 > n_buffer ? 0 : w + 1;
 | 
			
		||||
			w = w + 1 >= n_buffer ? 0 : w + 1;
 | 
			
		||||
		}
 | 
			
		||||
		*pos = w;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue