comparison transform/RealTimeEffectModelTransformer.cpp @ 975:d5404b8421b4

Fix some potential null derefs (from coverity scan)
author Chris Cannam
date Wed, 03 Sep 2014 11:26:21 +0100
parents 06579b8ffb7b
children b14064bd1f97
comparison
equal deleted inserted replaced
974:65494d0d9ded 975:d5404b8421b4
194 got = input->getData 194 got = input->getData
195 (m_input.getChannel(), blockFrame, blockSize, inbufs[0]); 195 (m_input.getChannel(), blockFrame, blockSize, inbufs[0]);
196 while (got < blockSize) { 196 while (got < blockSize) {
197 inbufs[0][got++] = 0.0; 197 inbufs[0][got++] = 0.0;
198 } 198 }
199 } 199 for (int ch = 1; ch < (int)m_plugin->getAudioInputCount(); ++ch) {
200 for (int ch = 1; ch < (int)m_plugin->getAudioInputCount(); ++ch) { 200 for (long i = 0; i < blockSize; ++i) {
201 for (long i = 0; i < blockSize; ++i) { 201 inbufs[ch][i] = inbufs[0][i];
202 inbufs[ch][i] = inbufs[0][i]; 202 }
203 } 203 }
204 } 204 }
205 } else { 205 } else {
206 if (inbufs && inbufs[0]) { 206 if (inbufs && inbufs[0]) {
207 got = input->getData(0, channelCount - 1, 207 got = input->getData(0, channelCount - 1,
211 for (int ch = 0; ch < channelCount; ++ch) { 211 for (int ch = 0; ch < channelCount; ++ch) {
212 inbufs[ch][got] = 0.0; 212 inbufs[ch][got] = 0.0;
213 } 213 }
214 ++got; 214 ++got;
215 } 215 }
216 } 216 for (int ch = channelCount; ch < (int)m_plugin->getAudioInputCount(); ++ch) {
217 for (int ch = channelCount; ch < (int)m_plugin->getAudioInputCount(); ++ch) { 217 for (long i = 0; i < blockSize; ++i) {
218 for (long i = 0; i < blockSize; ++i) { 218 inbufs[ch][i] = inbufs[ch % channelCount][i];
219 inbufs[ch][i] = inbufs[ch % channelCount][i]; 219 }
220 } 220 }
221 } 221 }
222 } 222 }
223 223
224 /* 224 /*