diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-19 22:37:27 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-19 22:37:27 +0200 |
commit | ffe64fb93469b76eaf3df017f7c2baebe47e16e2 (patch) | |
tree | cc6d3a273d1348d733f498cbcdfc81771c742489 /gst | |
parent | afccf53acee778b057f4f4bae19a41397fe8ff36 (diff) |
audioamplify: Fix off-by-one in wrap-positive mode
Diffstat (limited to 'gst')
-rw-r--r-- | gst/audiofx/audioamplify.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; \ } \ |