summaryrefslogtreecommitdiffstats
path: root/gst/audiofx
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-19 22:37:27 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-06-19 22:37:27 +0200
commitffe64fb93469b76eaf3df017f7c2baebe47e16e2 (patch)
treecc6d3a273d1348d733f498cbcdfc81771c742489 /gst/audiofx
parentafccf53acee778b057f4f4bae19a41397fe8ff36 (diff)
audioamplify: Fix off-by-one in wrap-positive mode
Diffstat (limited to 'gst/audiofx')
-rw-r--r--gst/audiofx/audioamplify.c4
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; \
} \