Browse Source

Fixed some out-of-range channel copying in the AudioBuffer move operator

tags/2021-05-28
jules 7 years ago
parent
commit
d5bdca9695
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h

+ 6
- 2
modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h View File

@@ -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
{


Loading…
Cancel
Save