From 90ed3f9e32abfaa87674dd30bb01757fe0fccf94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20de=20Vicente=20Pe=C3=B1a?= Date: Mon, 25 Mar 2019 10:10:54 +0100 Subject: [PATCH] AEC3: Signal dependent ERLE: adding bounds to the index used for accessing the filter frequency response. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this CL bounds are added to the index used for accessing the filter frequency response. That vector has always a capacity in memory equal to the final number of blocks of the main filter. However, at the initial part of the call or after an echo path change, a transition phase is started and a filter with a lower number of blocks is used and, therefore, its size is lower than that capacity during that transition phase. Bug: webrtc:10463 Change-Id: I6ebfdea43047a3fa993a27f2c52bb3024df84ffe Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128777 Reviewed-by: Per Ã…hgren Commit-Queue: Jesus de Vicente Pena Cr-Commit-Position: refs/heads/master@{#27264} --- .../audio_processing/aec3/signal_dependent_erle_estimator.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/audio_processing/aec3/signal_dependent_erle_estimator.cc b/modules/audio_processing/aec3/signal_dependent_erle_estimator.cc index 6a8d7e30e7..dbe8e487e1 100644 --- a/modules/audio_processing/aec3/signal_dependent_erle_estimator.cc +++ b/modules/audio_processing/aec3/signal_dependent_erle_estimator.cc @@ -328,8 +328,10 @@ void SignalDependentErleEstimator::ComputeEchoEstimatePerFilterSection( std::array H2_section; X2_section.fill(0.f); H2_section.fill(0.f); + const size_t block_limit = std::min(section_boundaries_blocks_[section + 1], + filter_frequency_response.size()); for (size_t block = section_boundaries_blocks_[section]; - block < section_boundaries_blocks_[section + 1]; ++block) { + block < block_limit; ++block) { std::transform(X2_section.begin(), X2_section.end(), spectrum_render_buffer.buffer[idx_render].begin(), X2_section.begin(), std::plus());