mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	alsa: guard agaist NULL areas
snd_pcm_ioplug_mmap_areas() can fail and return NULL Fixes #3600
This commit is contained in:
		
							parent
							
								
									7fa64a8b71
								
							
						
					
					
						commit
						920beea3eb
					
				
					 1 changed files with 15 additions and 15 deletions
				
			
		|  | @ -309,8 +309,8 @@ snd_pcm_pipewire_process(snd_pcm_pipewire_t *pw, struct pw_buffer *b, | ||||||
| 		xfer = nframes; | 		xfer = nframes; | ||||||
| 		if (xfer > 0) { | 		if (xfer > 0) { | ||||||
| 			const snd_pcm_channel_area_t *areas = snd_pcm_ioplug_mmap_areas(io); | 			const snd_pcm_channel_area_t *areas = snd_pcm_ioplug_mmap_areas(io); | ||||||
|  | 			if (areas != NULL) { | ||||||
| 				const snd_pcm_uframes_t offset = hw_ptr % io->buffer_size; | 				const snd_pcm_uframes_t offset = hw_ptr % io->buffer_size; | ||||||
| 
 |  | ||||||
| 				if (io->stream == SND_PCM_STREAM_PLAYBACK) | 				if (io->stream == SND_PCM_STREAM_PLAYBACK) | ||||||
| 					snd_pcm_areas_copy_wrap(pwareas, 0, nframes, | 					snd_pcm_areas_copy_wrap(pwareas, 0, nframes, | ||||||
| 							areas, offset, | 							areas, offset, | ||||||
|  | @ -323,7 +323,7 @@ snd_pcm_pipewire_process(snd_pcm_pipewire_t *pw, struct pw_buffer *b, | ||||||
| 							pwareas, 0, nframes, | 							pwareas, 0, nframes, | ||||||
| 							io->channels, xfer, | 							io->channels, xfer, | ||||||
| 							io->format); | 							io->format); | ||||||
| 
 | 			} | ||||||
| 			hw_ptr += xfer; | 			hw_ptr += xfer; | ||||||
| 			if (hw_ptr >= pw->boundary) | 			if (hw_ptr >= pw->boundary) | ||||||
| 				hw_ptr -= pw->boundary; | 				hw_ptr -= pw->boundary; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wim Taymans
						Wim Taymans