commit | 4f6c2b6eff60d31873365d59710906c59d2937c9 | [log] [tgz] |
---|---|---|
author | kwiberg <kwiberg@webrtc.org> | Thu May 26 10:40:51 2016 |
committer | Commit bot <commit-bot@chromium.org> | Thu May 26 10:40:56 2016 |
tree | a41288cd3d192ec07d4a8c4fc5683ccb2a7a06b1 | |
parent | 52a0bb422c9217230efb811dc7ef37520fb6bb6d [diff] |
Fix UBSan errors (left shift of negative value) BUG=chromium:601787 Review-Url: https://codereview.webrtc.org/2000403006 Cr-Commit-Position: refs/heads/master@{#12911}
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c b/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c index 1c0fd42..61b9d26 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c +++ b/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c
@@ -152,7 +152,7 @@ corr16[i] = (int16_t)WEBRTC_SPL_SHIFT_W32(corrmax[i], corrSh); corr16[i] = (int16_t)((corr16[i] * corr16[i]) >> 16); en16[i] = (int16_t)WEBRTC_SPL_SHIFT_W32(ener, enerSh); - totsh[i] = enerSh - (corrSh << 1); + totsh[i] = enerSh - 2 * corrSh; } /* Compare lagmax[0..3] for the (corr^2)/ener criteria */
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/smooth.c b/webrtc/modules/audio_coding/codecs/ilbc/smooth.c index f58e72c..58b37ee 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/smooth.c +++ b/webrtc/modules/audio_coding/codecs/ilbc/smooth.c
@@ -165,7 +165,7 @@ /* B_W32 is in Q30 ( B = 1 - ENH_A0/2 - A * w10/w00 ) */ scale1 = 31-bitsw10; scale2 = 21-scale1; - w10prim = w10 << scale1; + w10prim = w10 * (1 << scale1); w00prim = WEBRTC_SPL_SHIFT_W32(w00, -scale2); scale = bitsw00-scale2-15;