Codebase list alsa-lib / 9253f08
pcm: rate: fix the crash for the partial period copy The size argument in snd_pcm_rate_commit_area can be smaller than cont in drain. Return the original code. It should not make things worse. Perhaps, we can fill the rest of the period with silence in this case. Fixes: https://github.com/alsa-project/alsa-lib/issues/274 Signed-off-by: Jaroslav Kysela <perex@perex.cz> Jaroslav Kysela 1 year, 6 months ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
769769
770770 static int snd_pcm_rate_commit_area(snd_pcm_t *pcm, snd_pcm_rate_t *rate,
771771 snd_pcm_uframes_t appl_offset,
772 snd_pcm_uframes_t size,
772 snd_pcm_uframes_t size ATTRIBUTE_UNUSED,
773773 snd_pcm_uframes_t slave_size)
774774 {
775775 snd_pcm_uframes_t cont = pcm->buffer_size - appl_offset;
815815 pcm->format);
816816 snd_pcm_areas_copy(rate->pareas, cont,
817817 areas, 0,
818 pcm->channels, size - cont,
818 pcm->channels, pcm->period_size - cont,
819819 pcm->format);
820820
821821 snd_pcm_rate_write_areas1(pcm, rate->pareas, 0, rate->sareas, 0);