commit 610675b9bf50c3d02af9b98bea89cc116b005740
parent a92fe974f04ef41fffd2b322d9675f5e83373967
Author: Steven Atkinson <steven@atkinson.mn>
Date: Sat, 4 Feb 2023 19:11:40 -0800
Fill resizes with zeroes (#55)
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/NeuralAmpModeler/NeuralAmpModeler.cpp b/NeuralAmpModeler/NeuralAmpModeler.cpp
@@ -699,10 +699,14 @@ void NeuralAmpModeler::_PrepareBuffers(const size_t numChannels, const size_t nu
this->mOutputArray.resize(numChannels);
}
if (updateFrames) {
- for (auto c=0; c<this->mInputArray.size(); c++)
+ for (auto c=0; c<this->mInputArray.size(); c++) {
this->mInputArray[c].resize(numFrames);
- for (auto c=0; c<this->mOutputArray.size(); c++)
+ std::fill(this->mInputArray[c].begin(), this->mInputArray[c].end(), 0.0);
+ }
+ for (auto c=0; c<this->mOutputArray.size(); c++) {
this->mOutputArray[c].resize(numFrames);
+ std::fill(this->mOutputArray[c].begin(), this->mOutputArray[c].end(), 0.0);
+ }
}
// Would these ever get changed by something?
for (auto c=0; c<this->mInputArray.size(); c++)