mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audioconvert: fix potential NULL reference in resample_native_init
That was found by GCC fanalyze pass. Fixes warning:
    ../spa/plugins/audioconvert/resample-native.c: In function ‘resample_native_init’:
    ../spa/plugins/audioconvert/resample-native.c:385:9: warning: dereference of NULL ‘0B’ [CWE-476] [-Wanalyzer-null-dereference]
      385 |         spa_log_debug(r->log, "native %p: q:%d in:%d out:%d n_taps:%d n_phases:%d features:%08x:%08x",
			
			
This commit is contained in:
		
							parent
							
								
									0b758a2301
								
							
						
					
					
						commit
						ab71d2c3cb
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -381,6 +381,11 @@ int resample_native_init(struct resample *r)
 | 
				
			||||||
	build_filter(d->filter, d->filter_stride, n_taps, n_phases, scale);
 | 
						build_filter(d->filter, d->filter_stride, n_taps, n_phases, scale);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	d->info = find_resample_info(SPA_AUDIO_FORMAT_F32, r->cpu_flags);
 | 
						d->info = find_resample_info(SPA_AUDIO_FORMAT_F32, r->cpu_flags);
 | 
				
			||||||
 | 
						if (SPA_UNLIKELY(!d->info))
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
						    spa_log_error(r->log, "failed to find suitable resample format!");
 | 
				
			||||||
 | 
						    return -1;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spa_log_debug(r->log, "native %p: q:%d in:%d out:%d n_taps:%d n_phases:%d features:%08x:%08x",
 | 
						spa_log_debug(r->log, "native %p: q:%d in:%d out:%d n_taps:%d n_phases:%d features:%08x:%08x",
 | 
				
			||||||
			r, r->quality, in_rate, out_rate, n_taps, n_phases,
 | 
								r, r->quality, in_rate, out_rate, n_taps, n_phases,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue