Add checks and explicit buffer inititalization for FrameCombiner
Bug: chromium:335805780 Change-Id: I26825941076e78573de268f6e2da7215ee1ea762 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355740 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42544}
This commit is contained in:
parent
0bbc8ce12b
commit
81a3d95332
@ -96,7 +96,8 @@ void MixToFloatFrame(rtc::ArrayView<const AudioFrame* const> mix_list,
|
||||
// Convert to FloatS16 and mix.
|
||||
for (size_t i = 0; i < mix_list.size(); ++i) {
|
||||
InterleavedView<const int16_t> frame_data = mix_list[i]->data_view();
|
||||
for (size_t j = 0; j < NumChannels(mixing_buffer); ++j) {
|
||||
RTC_CHECK(!frame_data.empty());
|
||||
for (size_t j = 0; j < number_of_channels; ++j) {
|
||||
MonoView<float> channel = mixing_buffer[j];
|
||||
for (size_t k = 0; k < SamplesPerChannel(channel); ++k) {
|
||||
channel[k] += frame_data[number_of_channels * k + j];
|
||||
|
||||
@ -47,7 +47,7 @@ class FrameCombiner {
|
||||
Limiter limiter_;
|
||||
const bool use_limiter_;
|
||||
std::array<float, kMaximumChannelSize * kMaximumNumberOfChannels>
|
||||
mixing_buffer_;
|
||||
mixing_buffer_ = {};
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user