1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

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

This commit is contained in:
hogliux 2017-08-29 11:39:26 +01:00
parent 64597c2873
commit 35facc3656

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));