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

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

Issue 2571483002: Fix for integer overflow in NetEq. (Closed)
Patch Set: Used different approach to fix the issue. 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4c13b689a0a15ef0b35b6a08bf6f4b9f5abea077 100644
--- a/webrtc/modules/audio_coding/neteq/expand.cc
+++ b/webrtc/modules/audio_coding/neteq/expand.cc
@@ -676,7 +676,10 @@ void Expand::AnalyzeSignal(int16_t* random_vector) {
kUnvoicedLpcOrder + 1,
128);
int16_t unvoiced_prescale;
- if (WebRtcSpl_MaxAbsValueW16(unvoiced_vector, 128) > 4000) {
+ int16_t unvoiced_max_abs = WebRtcSpl_MaxAbsValueW16(unvoiced_vector, 128);
+ if (unvoiced_max_abs > 16383) {
+ unvoiced_prescale = 6;
kwiberg-webrtc 2016/12/13 13:09:46 So, let's see... you sum 2^7 values that are all l
+ } else if (unvoiced_max_abs > 4000) {
unvoiced_prescale = 4;
kwiberg-webrtc 2016/12/13 13:09:46 Sum of 2^7 values that are all less than 2^28, and
} else {
unvoiced_prescale = 0;
kwiberg-webrtc 2016/12/13 13:09:46 Sum of 2^7 values that are all less than 2^24 (act
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698