Avoid integer-overflow in WebRtcSpl_FilterARFastQ12
Simply use int64_t instead of int32_t for two local variables.
This avoids integer-overflow in some rare cases.
Bug: chromium:784216
Change-Id: Ie96835d6dc04e338b157469b74ead29e8bd403dd
Reviewed-on: https://webrtc-review.googlesource.com/26580
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21141}
diff --git a/common_audio/signal_processing/filter_ar_fast_q12.c b/common_audio/signal_processing/filter_ar_fast_q12.c
index 0767651..df9e518 100644
--- a/common_audio/signal_processing/filter_ar_fast_q12.c
+++ b/common_audio/signal_processing/filter_ar_fast_q12.c
@@ -25,8 +25,8 @@
RTC_DCHECK_GT(coefficients_length, 1);
for (i = 0; i < data_length; i++) {
- int32_t output = 0;
- int32_t sum = 0;
+ int64_t output = 0;
+ int64_t sum = 0;
for (j = coefficients_length - 1; j > 0; j--) {
sum += coefficients[j] * data_out[i - j];