Browse Source

tags/2021-05-28
jules 16 years ago
parent
commit
cc0a7a9e3b
2 changed files with 8 additions and 8 deletions
  1. +4
    -4
      juce_amalgamated.cpp
  2. +4
    -4
      src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp

+ 4
- 4
juce_amalgamated.cpp View File

@@ -22948,7 +22948,7 @@ AudioSampleBuffer::AudioSampleBuffer (const int numChannels_,


allocatedBytes = numChannels * numSamples * sizeof (float) + 32; allocatedBytes = numChannels * numSamples * sizeof (float) + 32;
allocatedData = (float*) juce_malloc (allocatedBytes); allocatedData = (float*) juce_malloc (allocatedBytes);
channels = (float**) juce_malloc (numChannels_ * sizeof (float*));
channels = (float**) juce_malloc ((numChannels_ + 1) * sizeof (float*));


float* chan = allocatedData; float* chan = allocatedData;
for (int i = 0; i < numChannels_; ++i) for (int i = 0; i < numChannels_; ++i)
@@ -22970,7 +22970,7 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
{ {
jassert (numChannels_ > 0); jassert (numChannels_ > 0);


channels = (float**) juce_malloc (numChannels_ * sizeof (float*));
channels = (float**) juce_malloc ((numChannels_ + 1) * sizeof (float*));


for (int i = 0; i < numChannels_; ++i) for (int i = 0; i < numChannels_; ++i)
{ {
@@ -22994,7 +22994,7 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo,
allocatedBytes = 0; allocatedBytes = 0;


if (numChannels_ > numChannels) if (numChannels_ > numChannels)
channels = (float**) juce_realloc (channels, numChannels_ * sizeof (float*));
channels = (float**) juce_realloc (channels, (numChannels_ + 1) * sizeof (float*));


numChannels = numChannels_; numChannels = numChannels_;
size = numSamples; size = numSamples;
@@ -23014,7 +23014,7 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw()
: numChannels (other.numChannels), : numChannels (other.numChannels),
size (other.size) size (other.size)
{ {
channels = (float**) juce_malloc (other.numChannels * sizeof (float*));
channels = (float**) juce_malloc ((other.numChannels + 1) * sizeof (float*));


if (other.allocatedData != 0) if (other.allocatedData != 0)
{ {


+ 4
- 4
src/juce_appframework/audio/dsp/juce_AudioSampleBuffer.cpp View File

@@ -49,7 +49,7 @@ AudioSampleBuffer::AudioSampleBuffer (const int numChannels_,
allocatedBytes = numChannels * numSamples * sizeof (float) + 32; allocatedBytes = numChannels * numSamples * sizeof (float) + 32;
allocatedData = (float*) juce_malloc (allocatedBytes); allocatedData = (float*) juce_malloc (allocatedBytes);
channels = (float**) juce_malloc (numChannels_ * sizeof (float*));
channels = (float**) juce_malloc ((numChannels_ + 1) * sizeof (float*));
float* chan = allocatedData; float* chan = allocatedData;
for (int i = 0; i < numChannels_; ++i) for (int i = 0; i < numChannels_; ++i)
@@ -71,7 +71,7 @@ AudioSampleBuffer::AudioSampleBuffer (float** dataToReferTo,
{ {
jassert (numChannels_ > 0); jassert (numChannels_ > 0);
channels = (float**) juce_malloc (numChannels_ * sizeof (float*));
channels = (float**) juce_malloc ((numChannels_ + 1) * sizeof (float*));
for (int i = 0; i < numChannels_; ++i) for (int i = 0; i < numChannels_; ++i)
{ {
@@ -95,7 +95,7 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo,
allocatedBytes = 0; allocatedBytes = 0;
if (numChannels_ > numChannels) if (numChannels_ > numChannels)
channels = (float**) juce_realloc (channels, numChannels_ * sizeof (float*));
channels = (float**) juce_realloc (channels, (numChannels_ + 1) * sizeof (float*));
numChannels = numChannels_; numChannels = numChannels_;
size = numSamples; size = numSamples;
@@ -115,7 +115,7 @@ AudioSampleBuffer::AudioSampleBuffer (const AudioSampleBuffer& other) throw()
: numChannels (other.numChannels), : numChannels (other.numChannels),
size (other.size) size (other.size)
{ {
channels = (float**) juce_malloc (other.numChannels * sizeof (float*));
channels = (float**) juce_malloc ((other.numChannels + 1) * sizeof (float*));
if (other.allocatedData != 0) if (other.allocatedData != 0)
{ {


Loading…
Cancel
Save