From ffe64fb93469b76eaf3df017f7c2baebe47e16e2 Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Fri, 19 Jun 2009 22:37:27 +0200 Subject: audioamplify: Fix off-by-one in wrap-positive mode --- gst/audiofx/audioamplify.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gst/audiofx') diff --git a/gst/audiofx/audioamplify.c b/gst/audiofx/audioamplify.c index 9e33e552..86754da8 100644 --- a/gst/audiofx/audioamplify.c +++ b/gst/audiofx/audioamplify.c @@ -176,10 +176,10 @@ gst_audio_amplify_transform_##type##_wrap_negative (GstAudioAmplify * filter, \ while (num_samples--) { \ glong val = *d * filter->amplification; \ if (val > MAX_##type) \ - val = MIN_##type + (val - MIN_##type) % ((glong) MAX_##type - \ + val = MIN_##type + (val - MIN_##type) % ((glong) MAX_##type + 1 - \ MIN_##type); \ else if (val < MIN_##type) \ - val = MAX_##type - (MAX_##type - val) % ((glong) MAX_##type - \ + val = MAX_##type - (MAX_##type - val) % ((glong) MAX_##type + 1 - \ MIN_##type); \ *d++ = val; \ } \ -- cgit