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}
This commit is contained in:
Henrik Lundin
2017-11-28 15:26:52 +01:00
committed by Commit Bot
parent 3863153267
commit 6f54e7ab67

View File

@ -25,8 +25,8 @@ void WebRtcSpl_FilterARFastQ12(const int16_t* data_in,
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];