mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: audioconvert: ensure that noise::intesity is not too big
Shifting by 64 or more would not fit into `uint64_t`.
This commit is contained in:
		
							parent
							
								
									bb205d3d85
								
							
						
					
					
						commit
						1ac02db6a9
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -71,6 +71,9 @@ int noise_init(struct noise *ns)
 | 
			
		|||
	if (info == NULL)
 | 
			
		||||
		return -ENOTSUP;
 | 
			
		||||
 | 
			
		||||
	if (ns->intensity >= 64)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i < SPA_N_ELEMENTS(ns->tab); i++)
 | 
			
		||||
		ns->tab[i] = (drand48() - 0.5) / (UINT64_C(1) << ns->intensity);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue