mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-07 02:39:56 +00:00
GRIM: Fix mismatched new[]/delete[] vs malloc/free
This commit is contained in:
parent
c3fa256d0c
commit
33e3d99721
engines/grim/imuse
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user