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

Side by Side Diff: webrtc/modules/audio_coding/codecs/ilbc/smooth.c

Issue 2258543002: WebRtcIlbcfix_Smooth: Fix UBSan fuzzer bug (left shift of 1 by 31 overflows) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 /* num in Q34 */ 161 /* num in Q34 */
162 num=ENH_A0_MINUS_A0A0DIV4; 162 num=ENH_A0_MINUS_A0A0DIV4;
163 } 163 }
164 164
165 /* A sqrt( (ENH_A0-(ENH_A0^2)/4)*(w00*w00)/(w11*w00 + w10*w10) ) in Q9 */ 165 /* A sqrt( (ENH_A0-(ENH_A0^2)/4)*(w00*w00)/(w11*w00 + w10*w10) ) in Q9 */
166 A = (int16_t)WebRtcSpl_SqrtFloor(WebRtcSpl_DivW32W16(num, denomW16)); 166 A = (int16_t)WebRtcSpl_SqrtFloor(WebRtcSpl_DivW32W16(num, denomW16));
167 167
168 /* B_W32 is in Q30 ( B = 1 - ENH_A0/2 - A * w10/w00 ) */ 168 /* B_W32 is in Q30 ( B = 1 - ENH_A0/2 - A * w10/w00 ) */
169 scale1 = 31-bitsw10; 169 scale1 = 31-bitsw10;
170 scale2 = 21-scale1; 170 scale2 = 21-scale1;
171 w10prim = w10 * (1 << scale1); 171 w10prim = w10 == 0 ? 0 : w10 * (1 << scale1);
172 w00prim = WEBRTC_SPL_SHIFT_W32(w00, -scale2); 172 w00prim = WEBRTC_SPL_SHIFT_W32(w00, -scale2);
173 scale = bitsw00-scale2-15; 173 scale = bitsw00-scale2-15;
174 174
175 if (scale>0) { 175 if (scale>0) {
176 w10prim >>= scale; 176 w10prim >>= scale;
177 w00prim >>= scale; 177 w00prim >>= scale;
178 } 178 }
179 179
180 if ((w00prim>0)&&(w10prim>0)) { 180 if ((w00prim>0)&&(w10prim>0)) {
181 w11_div_w00=WebRtcSpl_DivW32W16(w10prim, (int16_t)w00prim); 181 w11_div_w00=WebRtcSpl_DivW32W16(w10prim, (int16_t)w00prim);
(...skipping 19 matching lines...) Expand all
201 } 201 }
202 202
203 /* create smoothed sequence */ 203 /* create smoothed sequence */
204 204
205 WebRtcSpl_ScaleAndAddVectors(surround, A, 9, 205 WebRtcSpl_ScaleAndAddVectors(surround, A, 9,
206 current, B, 14, 206 current, B, 14,
207 odata, ENH_BLOCKL); 207 odata, ENH_BLOCKL);
208 } 208 }
209 return; 209 return;
210 } 210 }
OLDNEW
« 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