From: Lennart Poettering Date: Fri, 18 Jul 2008 19:21:23 +0000 (+0200) Subject: clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction X-Git-Tag: v1.0.17a~6 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=0fbfe2d8d6aac06e6615b7109ffc1fea8c62dee6;p=alsa-lib.git 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 Signed-off-by: Takashi Iwai --- diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c index c73a02b2..c199d8df 100644 --- a/src/pcm/pcm_plugin.c +++ b/src/pcm/pcm_plugin.c @@ -203,7 +203,7 @@ static snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t snd_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;