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:
@ -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 */
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user