mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
Added the check to avoid NULL pointer dereference in snd_pcm_areas_copy
This commit is contained in:
parent
efb7a55efc
commit
21cbbc6d0d
1 changed files with 5 additions and 4 deletions
|
|
@ -865,10 +865,11 @@ static int snd_pcm_share_start(snd_pcm_t *pcm)
|
||||||
snd_pcm_uframes_t cont = pcm->buffer_size - offset;
|
snd_pcm_uframes_t cont = pcm->buffer_size - offset;
|
||||||
if (cont < frames)
|
if (cont < frames)
|
||||||
frames = cont;
|
frames = cont;
|
||||||
snd_pcm_areas_copy(pcm->running_areas, offset,
|
if (pcm->stopped_areas != NULL)
|
||||||
pcm->stopped_areas, xfer,
|
snd_pcm_areas_copy(pcm->running_areas, offset,
|
||||||
pcm->channels, frames,
|
pcm->stopped_areas, xfer,
|
||||||
pcm->format);
|
pcm->channels, frames,
|
||||||
|
pcm->format);
|
||||||
xfer += frames;
|
xfer += frames;
|
||||||
}
|
}
|
||||||
snd_pcm_mmap_appl_forward(pcm, hw_avail);
|
snd_pcm_mmap_appl_forward(pcm, hw_avail);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue