clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
PATCH 1/3 clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
The clamping of the input parameter in snd_pcm_rewind()/_forward() is in the wrong direction.
Signed-off-by Lennart Poettering <[email protected]>
--- src/pcm/pcm_plugin.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
src/pcm/pcm_plugin.c +2 -2
@@ -203,7 +203,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_tsnd_pcm_sframes_t n =snd_pcm_mmap_hw_avail (pcm);snd_pcm_sframes_t sframes; -if ((snd_pcm_uframes_t )n > frames) +if ((snd_pcm_uframes_t )n < frames) frames = n;if (frames ==0 )return 0 ;
@@ -236,7 +236,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_snd_pcm_sframes_t n =snd_pcm_mmap_avail (pcm);snd_pcm_uframes_t sframes; -if ((snd_pcm_uframes_t )n > frames) +if ((snd_pcm_uframes_t )n < frames) frames = n;if (frames ==0 )return 0 ;
Signature · 8 lines
1.5.6 Lennart -- Lennart Poettering Red Hat, Inc. lennart [at] poettering [dot] net ICQ# 11060553 http://0pointer.net/lennart/ GnuPG 0x1A015CC4