SWORD1: Fix mismatching malloc/delete[]

This commit is contained in:
Eugene Sandulenko 2020-04-27 22:51:41 +02:00
parent 1cf604363c
commit 4a6c0fb35e

View File

@ -130,11 +130,11 @@ void Sound::checkSpeechFileEndianness() {
int16 *data = uncompressSpeech(index + _cowHeaderSize, sampleSize, &size, &leOk);
uint32 maxSamples = size > 2000 ? 2000 : size;
double le_diff = endiannessHeuristicValue(data, size, maxSamples);
delete[] data;
free(data);
_bigEndianSpeech = true;
data = uncompressSpeech(index + _cowHeaderSize, sampleSize, &size, &beOk);
double be_diff = endiannessHeuristicValue(data, size, maxSamples);
delete [] data;
free(data);
// Set the big endian flag
if (leOk && !beOk)
_bigEndianSpeech = false;