mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
Check for empty buffer
This commit is contained in:
parent
47659b0810
commit
f1a9f40da0
@ -179,7 +179,10 @@ void FIFOSampleBuffer::ensureCapacity(uint capacityRequirement)
|
|||||||
}
|
}
|
||||||
// Align the buffer to begin at 16byte cache line boundary for optimal performance
|
// Align the buffer to begin at 16byte cache line boundary for optimal performance
|
||||||
temp = (SAMPLETYPE *)(((ulong)tempUnaligned + 15) & (ulong)-16);
|
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;
|
delete[] bufferUnaligned;
|
||||||
buffer = temp;
|
buffer = temp;
|
||||||
bufferUnaligned = tempUnaligned;
|
bufferUnaligned = tempUnaligned;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user