webrtc/modules/audio_processing
Alex Loiko c531af77c3 Fix 'Left shift cannot be represented in int32_t'.
In the legacy C part of AGC, an audio level 'cur_level' is represented as

  (1+frac) * 2^(31 - zeros)

The 'zeros' exponent part is used for looking up a gain value in a
table, and 'frac' is used for interpolating between two nearby table
values. Code snippet below:

  zeros = WebRtcSpl_NormU32((uint32_t)cur_level);
  tmp32 = (cur_level << zeros) & 0x7FFFFFFF;
  frac = (int16_t)(tmp32 >> 19);

In the second line, 'cur_level' is shifted upwards so that the leading
bit is '1', after which the leading bit is cleared. The result is
'frac' in Q31.

The compiler type of 'cur_level << zeros' is 'int32_t'. This is a
fuzzer error 'Left shift cannot be represented in int32_t', 
because the leading sign bit is 1. This CL changes the compiler type to
uint32_t.

Bug: chromium:776286
Change-Id: Ie29552b75e690057bd76fc88e747841b531e3802
Reviewed-on: https://webrtc-review.googlesource.com/14841
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20405}
2017-10-24 09:56:08 +00:00
..
aec Fixing unsafe conversion 2017-10-19 10:59:50 +00:00
aec3 Separate AEC3 config from AudioProcessing::Config. 2017-10-19 08:19:52 +00:00
aec_dump Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
aecm Fix of integer overflow in WebRtcAecm_ProcessBlock / ApmTest.Process 2017-10-23 14:25:37 +00:00
agc Fix 'Left shift cannot be represented in int32_t'. 2017-10-24 09:56:08 +00:00
agc2 AGC2 dummy module: fixed gain param, APM integration, audioproc_f adaptation 2017-10-13 11:05:37 +00:00
beamformer Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_detector Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
include Separate AEC3 config from AudioProcessing::Config. 2017-10-19 08:19:52 +00:00
intelligibility Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
level_controller Enable and update some bit exactness tests 2017-10-03 07:48:30 +00:00
logging Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
ns Forgotten 'memset' in NoiseSuppression. 2017-10-23 12:11:47 +00:00
test WebRTC VAD wrapper for APM-QA 2017-10-24 08:34:38 +00:00
transient Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
utility Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
vad Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
audio_buffer.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
audio_buffer.h Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
audio_buffer_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
audio_processing_impl.cc Separate AEC3 config from AudioProcessing::Config. 2017-10-19 08:19:52 +00:00
audio_processing_impl.h Enable Echo Control at injection. 2017-10-16 13:28:37 +00:00
audio_processing_impl_locking_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
audio_processing_impl_unittest.cc Change return types of refcount methods. 2017-10-20 07:46:03 +00:00
audio_processing_performance_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
audio_processing_unittest.cc Stop using std::tr1 2017-10-23 22:11:58 +00:00
BUILD.gn Added experiment to improve handling of frame length changes in NetEq. 2017-10-13 13:26:57 +00:00
common.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
config_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
debug.proto
DEPS Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_cancellation_bit_exact_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_cancellation_impl.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_cancellation_impl.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_cancellation_impl_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_control_mobile_impl.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_control_mobile_impl.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
echo_control_mobile_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
gain_control_for_experimental_agc.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
gain_control_for_experimental_agc.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
gain_control_impl.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
gain_control_impl.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
gain_control_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
level_estimator_impl.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
level_estimator_impl.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
level_estimator_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
low_cut_filter.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
low_cut_filter.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
low_cut_filter_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
noise_suppression_impl.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
noise_suppression_impl.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
noise_suppression_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
OWNERS
render_queue_item_verifier.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
residual_echo_detector.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
residual_echo_detector.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
residual_echo_detector_complexity_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
residual_echo_detector_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
rms_level.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
rms_level.h Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
rms_level_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
splitting_filter.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
splitting_filter.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
splitting_filter_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
three_band_filter_bank.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
three_band_filter_bank.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
typing_detection.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
typing_detection.h Adding NOLINT for typedefs.h and common_types.h 2017-09-15 13:03:51 +00:00
voice_detection_impl.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
voice_detection_impl.h Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00
voice_detection_unittest.cc Fixing WebRTC after moving from src/webrtc to src/ 2017-09-15 05:02:56 +00:00