From 5a78eae780a2afe4f3fc94b4fe7f3fee8641ae74 Mon Sep 17 00:00:00 2001 From: Ivo Creusen Date: Tue, 3 Nov 2020 16:36:17 +0100 Subject: [PATCH] Initialize variables to measure preemptive expansion and acceleration The variables that are used to track the amount of preemptive expansion and acceleration are not initialized before being passed to their respective functions. However, these function can fail in certain cases, and when they do the uninitialized memory will pollute the NetEq statistics. Bug: chromium:1140376 Change-Id: I004fbaaf8d24de01dd1997fb73bdf93ca88ceaaf Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191480 Commit-Queue: Ivo Creusen Reviewed-by: Henrik Lundin Cr-Commit-Position: refs/heads/master@{#32544} --- modules/audio_coding/neteq/neteq_impl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index ba6d9c1c7d..f8d5d9dc16 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -1722,7 +1722,7 @@ int NetEqImpl::DoAccelerate(int16_t* decoded_buffer, decoded_length = required_samples * num_channels; } - size_t samples_removed; + size_t samples_removed = 0; Accelerate::ReturnCodes return_code = accelerate_->Process(decoded_buffer, decoded_length, fast_accelerate, algorithm_buffer_.get(), &samples_removed); @@ -1800,7 +1800,7 @@ int NetEqImpl::DoPreemptiveExpand(int16_t* decoded_buffer, decoded_length = required_samples * num_channels; } - size_t samples_added; + size_t samples_added = 0; PreemptiveExpand::ReturnCodes return_code = preemptive_expand_->Process( decoded_buffer, decoded_length, old_borrowed_samples_per_channel, algorithm_buffer_.get(), &samples_added);