mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 13:18:26 +02:00
Ensure memory is cleared to make compiler happy
This commit is contained in:
parent
d834a05053
commit
178017db2b
1 changed files with 1 additions and 1 deletions
|
@ -44,7 +44,7 @@ AudioDataPointer AudioData::make(uint32_t numSamples, uint32_t numChannels,
|
||||||
const size_t memorySize = sizeof(AudioData) + bufferSize;
|
const size_t memorySize = sizeof(AudioData) + bufferSize;
|
||||||
|
|
||||||
// Allocate the memory for the audio data object and the buffer
|
// Allocate the memory for the audio data object and the buffer
|
||||||
void* memory = ::malloc(memorySize);
|
void* memory = ::calloc(1, memorySize);
|
||||||
auto audioData = reinterpret_cast<AudioData*>(memory);
|
auto audioData = reinterpret_cast<AudioData*>(memory);
|
||||||
auto buffer = reinterpret_cast<AudioSample*>(audioData + 1);
|
auto buffer = reinterpret_cast<AudioSample*>(audioData + 1);
|
||||||
assert(((char*)buffer - (char*)audioData) == sizeof(AudioData));
|
assert(((char*)buffer - (char*)audioData) == sizeof(AudioData));
|
||||||
|
|
Loading…
Reference in a new issue