diff --git a/libavcodec/celp_filters.c b/libavcodec/celp_filters.c
index 381ffa489408c96bfcd9dd0dd84a6878d221d48e..61474f5906d42977f1dec5cee60db8d158d8d903 100644
--- a/libavcodec/celp_filters.c
+++ b/libavcodec/celp_filters.c
@@ -133,7 +133,7 @@ void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
         out2 -= val * old_out2;
         out3 -= val * old_out3;
 
-        for (i = 5; i <= filter_length; i += 2) {
+        for (i = 5; i < filter_length; i += 2) {
             old_out3 = out[-i];
             val = filter_coeffs[i-1];