No check performed on `snd_pcm_ioplug_mmap_areas()` return value can result in ALSA crashing
We have received a bug report (corroborated by a second user) about our application occasionally crashing with a failed assertion from ALSA. A backtrace pointed to the following section of PipeWire code as the culprit:
According to its documentation, snd_pcm_ioplug_mmap_areas()
can fail and return NULL
; if this happens, no check is performed and the value is passed as-is to snd_pcm_areas_copy_wrap()
, which will eventually result in a failed assertion in ALSA's snd_pcm_areas_copy()
.