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}
This commit is contained in:
kwiberg
2016-05-26 03:40:51 -07:00
committed by Commit bot
parent 52a0bb422c
commit 4f6c2b6eff
2 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@ size_t WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
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 */

View File

@ -165,7 +165,7 @@ void WebRtcIlbcfix_Smooth(
/* 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;