commit | 1a4cf30047ef214acc895915c68a3942505f1502 | [log] [tgz] |
---|---|---|
author | Jesús de Vicente Peña <devicentepena@webrtc.org> | Tue Aug 22 14:31:13 2023 |
committer | WebRTC LUCI CQ <webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Aug 23 08:11:33 2023 |
tree | 7c71e7337941ea2e668294e7ea7af5a5e90a28e4 | |
parent | 45ccf63c0f885b3fc98b0d5aafdb922bd372d311 [diff] |
Avoiding to increase an iterator when the result can be larger than their container end. Bug: webrtc:15438 Change-Id: I0d75436bc845590c76466bde7007e921f842a9d4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317320 Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40605}
diff --git a/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc b/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc index 8eb27c3..c8ac417 100644 --- a/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc +++ b/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc
@@ -162,7 +162,8 @@ float penalization_per_delay = 1.0f; float max_histogram_value = -1.0f; for (auto it = histogram_.begin(); - it + kMatchedFilterWindowSizeSubBlocks <= histogram_.end(); + std::distance(it, histogram_.end()) >= + static_cast<int>(kMatchedFilterWindowSizeSubBlocks); it = it + kMatchedFilterWindowSizeSubBlocks) { auto it_max_element = std::max_element(it, it + kMatchedFilterWindowSizeSubBlocks);