GRIM: Fix mismatched new[]/delete[] vs malloc/free

This commit is contained in:
Bastien Bouclet 2018-06-03 07:44:39 +02:00
parent c3fa256d0c
commit 33e3d99721
2 changed files with 2 additions and 2 deletions

@ -106,7 +106,7 @@ int32 McmpMgr::decompressSample(int32 offset, int32 size, byte **comp_final) {
last_block = _numCompItems - 1;
int32 blocks_final_size = 0x2000 * (1 + last_block - first_block);
*comp_final = new byte[blocks_final_size];
*comp_final = static_cast<byte *>(malloc(blocks_final_size));
final_size = 0;
for (i = first_block; i <= last_block; i++) {

@ -356,7 +356,7 @@ int32 ImuseSndMgr::getDataFromRegion(SoundDesc *sound, int region, byte **buf, i
if (sound->mcmpData) {
size = sound->mcmpMgr->decompressSample(region_offset + offset, size, buf);
} else {
*buf = new byte[size];
*buf = static_cast<byte *>(malloc(size));
sound->inStream->seek(region_offset + offset + sound->headerSize, SEEK_SET);
sound->inStream->read(*buf, size);
}