Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: webrtc/modules/audio_coding/neteq/expand.cc

Issue 2571483002: Fix for integer overflow in NetEq. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/expand.cc
diff --git a/webrtc/modules/audio_coding/neteq/expand.cc b/webrtc/modules/audio_coding/neteq/expand.cc
index ffe4370e4e61e8766c50ce8efcf22c96bd9723bf..02d6290f2f589cfa26786920afb3f3808ef61665 100644
--- a/webrtc/modules/audio_coding/neteq/expand.cc
+++ b/webrtc/modules/audio_coding/neteq/expand.cc
@@ -681,10 +681,8 @@ void Expand::AnalyzeSignal(int16_t* random_vector) {
} else {
unvoiced_prescale = 0;
}
- int32_t unvoiced_energy = WebRtcSpl_DotProductWithScale(unvoiced_vector,
- unvoiced_vector,
- 128,
- unvoiced_prescale);
+ int32_t unvoiced_energy = WebRtcSpl_DotProductWithScale_64b(
hlundin-webrtc 2016/12/12 21:40:41 Will you not end up with the same overflow problem
ivoc 2016/12/13 08:43:09 Oops, good catch, I'll change this to int64_t.
kwiberg-webrtc 2016/12/13 08:45:36 I would imagine so. Since all the partial sums are
+ unvoiced_vector, unvoiced_vector, 128, unvoiced_prescale);
// Normalize |unvoiced_energy| to 28 or 29 bits to preserve sqrt() accuracy.
int16_t unvoiced_scale = WebRtcSpl_NormW32(unvoiced_energy) - 3;

Powered by Google App Engine
This is Rietveld 408576698