avcodec/dolby_e: use av_clip_uintp2()
[ffmpeg.git] / libavcodec / celp_filters.c
index 5e65c2e..fafedd9 100644 (file)
@@ -67,7 +67,7 @@ int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs,
     for (n = 0; n < buffer_length; n++) {
         int sum = -rounder, sum1;
         for (i = 1; i <= filter_length; i++)
-            sum += filter_coeffs[i-1] * out[n-i];
+            sum += (unsigned)(filter_coeffs[i-1] * out[n-i]);
 
         sum1 = ((-sum >> 12) + in[n]) >> shift;
         sum  = av_clip_int16(sum1);
@@ -136,7 +136,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];