summaryrefslogtreecommitdiff
path: root/muse2/muse/node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/node.cpp')
-rw-r--r--muse2/muse/node.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/muse2/muse/node.cpp b/muse2/muse/node.cpp
index b6b40738..20440b45 100644
--- a/muse2/muse/node.cpp
+++ b/muse2/muse/node.cpp
@@ -1851,12 +1851,15 @@ void AudioTrack::setTotalOutChannels(int num)
// Number of allocated buffers is always MAX_CHANNELS or more, even if _totalOutChannels is less.
if(chans < MAX_CHANNELS)
chans = MAX_CHANNELS;
- for(int i = 0; i < chans; ++i)
- {
- if(outBuffers[i])
- free(outBuffers[i]);
- }
- delete[] outBuffers;
+ if(outBuffers)
+ {
+ for(int i = 0; i < chans; ++i)
+ {
+ if(outBuffers[i])
+ free(outBuffers[i]);
+ }
+ delete[] outBuffers;
+ }
_totalOutChannels = num;
chans = num;