1
0
mirror of https://github.com/RPCS3/soundtouch.git synced 2024-11-08 20:12:27 +01:00

Check for empty buffer

This commit is contained in:
oparviai 2009-02-27 17:24:42 +00:00
parent 47659b0810
commit f1a9f40da0

View File

@ -179,7 +179,10 @@ void FIFOSampleBuffer::ensureCapacity(uint capacityRequirement)
}
// Align the buffer to begin at 16byte cache line boundary for optimal performance
temp = (SAMPLETYPE *)(((ulong)tempUnaligned + 15) & (ulong)-16);
memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE));
if (samplesInBuffer)
{
memcpy(temp, ptrBegin(), samplesInBuffer * channels * sizeof(SAMPLETYPE));
}
delete[] bufferUnaligned;
buffer = temp;
bufferUnaligned = tempUnaligned;