diff 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
line wrap: on
line diff
--- a/transform/RealTimeEffectModelTransformer.cpp	Wed Sep 03 11:22:46 2014 +0100
+++ b/transform/RealTimeEffectModelTransformer.cpp	Wed Sep 03 11:26:21 2014 +0100
@@ -196,10 +196,10 @@
                 while (got < blockSize) {
                     inbufs[0][got++] = 0.0;
                 }          
-            }
-            for (int ch = 1; ch < (int)m_plugin->getAudioInputCount(); ++ch) {
-                for (long i = 0; i < blockSize; ++i) {
-                    inbufs[ch][i] = inbufs[0][i];
+                for (int ch = 1; ch < (int)m_plugin->getAudioInputCount(); ++ch) {
+                    for (long i = 0; i < blockSize; ++i) {
+                        inbufs[ch][i] = inbufs[0][i];
+                    }
                 }
             }
 	} else {
@@ -213,10 +213,10 @@
                     }
                     ++got;
                 }
-            }
-            for (int ch = channelCount; ch < (int)m_plugin->getAudioInputCount(); ++ch) {
-                for (long i = 0; i < blockSize; ++i) {
-                    inbufs[ch][i] = inbufs[ch % channelCount][i];
+                for (int ch = channelCount; ch < (int)m_plugin->getAudioInputCount(); ++ch) {
+                    for (long i = 0; i < blockSize; ++i) {
+                        inbufs[ch][i] = inbufs[ch % channelCount][i];
+                    }
                 }
             }
 	}