Browse Source

Fixed a potential use-after-free in AudioBuffer's move semantics

tags/2021-05-28
hogliux 8 years ago
parent
commit
35facc3656
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_audio_basics/buffers/juce_AudioSampleBuffer.h

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

@@ -184,7 +184,7 @@ public:
: numChannels (other.numChannels),
size (other.size),
allocatedBytes (other.allocatedBytes),
channels (other.channels),
channels (numChannels < (int) numElementsInArray (preallocatedChannelSpace) ? preallocatedChannelSpace : other.channels),
allocatedData (static_cast<HeapBlock<char, true>&&> (other.allocatedData)),
isClear (other.isClear)
{
@@ -200,7 +200,7 @@ public:
numChannels = other.numChannels;
size = other.size;
allocatedBytes = other.allocatedBytes;
channels = other.channels;
channels = numChannels < (int) numElementsInArray (preallocatedChannelSpace) ? preallocatedChannelSpace : other.channels;
allocatedData = static_cast<HeapBlock<char, true>&&> (other.allocatedData);
isClear = other.isClear;
memcpy (preallocatedChannelSpace, other.preallocatedChannelSpace, sizeof (preallocatedChannelSpace));


Loading…
Cancel
Save