diff --git a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h index 883666dc00..97c13756df 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h +++ b/modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h @@ -183,7 +183,9 @@ public: if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) { channels = preallocatedChannelSpace; - memcpy (preallocatedChannelSpace, other.channels, sizeof (preallocatedChannelSpace)); + + for (int i = 0; i < numChannels; ++i) + preallocatedChannelSpace[i] = other.channels[i]; } else { @@ -207,7 +209,9 @@ public: if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) { channels = preallocatedChannelSpace; - memcpy (preallocatedChannelSpace, other.channels, sizeof (preallocatedChannelSpace)); + + for (int i = 0; i < numChannels; ++i) + preallocatedChannelSpace[i] = other.channels[i]; } else {