Shifted value doesn't fit in 'int32_t'.

This CL replaces one 'int32_t' with 'uint32_t'. The value is a
non-negative energy, and the number of leading zeros is
computed. During computation, a shift can cause it to overflow.

Issue was found by the Audio Processing fuzzer.

Bug: chromium:778939, chromium:778921, chromium:778919
Change-Id: I3d7e0b547e6b0edcd9995903517ea851142a08c1
Reviewed-on: https://webrtc-review.googlesource.com/16433
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20470}
This commit is contained in:
Alex Loiko 2017-10-27 14:57:38 +02:00 committed by Commit Bot
parent 45bc087c9b
commit c7b18fef19

View file

@ -574,7 +574,8 @@ int16_t WebRtcAgc_ProcessVad(AgcVad* state, // (i) VAD state
const int16_t* in, // (i) Speech signal
size_t nrSamples) // (i) number of samples
{
int32_t out, nrg, tmp32, tmp32b;
uint32_t nrg;
int32_t out, tmp32, tmp32b;
uint16_t tmpU16;
int16_t k, subfr, tmp16;
int16_t buf1[8];