AEC3: Gain limiter: Improving the behavior of the gain limiter.

In this work, we change the behavior of the gain limiter so it also looks at the energy
 on farend around the default delay for deciding the suppression gain
that should be applied at the initial portion of the call.

Bug: webrtc:9311,chromium:846724
Change-Id: I0b777cedbbd7fd689e72070f72237296ce120d3c
Reviewed-on: https://webrtc-review.googlesource.com/78960
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23400}
diff --git a/modules/audio_processing/aec3/vector_buffer.h b/modules/audio_processing/aec3/vector_buffer.h
index a7f9932..c7d4f68 100644
--- a/modules/audio_processing/aec3/vector_buffer.h
+++ b/modules/audio_processing/aec3/vector_buffer.h
@@ -36,6 +36,7 @@
   int OffsetIndex(int index, int offset) const {
     RTC_DCHECK_GE(size, offset);
     RTC_DCHECK_EQ(buffer.size(), static_cast<size_t>(size));
+    RTC_DCHECK_GE(size + index + offset, 0);
     return (size + index + offset) % size;
   }