Forgotten 'memset' in NoiseSuppression.

The 'parametricNoise' field is never initialized in the
'WebRtcNs_InitCore' function that initializes a 'NoiseSuppressionC'
struct.

This leads to use of unititialized value, which may affect the audio
output and result of the noise suppressor.

The issue was found by the Chrome fuzzer:
https://clusterfuzz.com/v2/testcase-detail/4749034115039232

Bug: chromium:776673
Change-Id: I1c3fd80cff178f2d5917064ad07f88c7b9a29e7d
Reviewed-on: https://webrtc-review.googlesource.com/14556
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20388}
This commit is contained in:
Alex Loiko
2017-10-23 13:15:32 +02:00
committed by Commit Bot
parent 8731176b92
commit bd92d8dd2a

View File

@ -167,6 +167,8 @@ int WebRtcNs_InitCore(NoiseSuppressionC* self, uint32_t fs) {
// Window time-average of input magnitude spectrum.
self->featureData[6] = 0.f;
memset(self->parametricNoise, 0, sizeof(float) * HALF_ANAL_BLOCKL);
// Histogram quantities: used to estimate/update thresholds for features.
memset(self->histLrt, 0, sizeof(int) * HIST_PAR_EST);
memset(self->histSpecFlat, 0, sizeof(int) * HIST_PAR_EST);