Use MALLOC for hoard reading

This commit is contained in:
Kp 2013-10-06 18:08:39 +00:00
parent 9f87b72a7d
commit e436a5dc43

View file

@ -5181,7 +5181,7 @@ void init_hoard_data()
}
GameSounds[Num_sound_files+i].length = len;
GameSounds[Num_sound_files+i].data = d_malloc(len);
MALLOC(GameSounds[Num_sound_files+i].data, ubyte, len);
PHYSFS_read(ifile,GameSounds[Num_sound_files+i].data,1,len);
if (GameArg.SndDigiSampleRate == SAMPLE_RATE_11K) {
@ -5253,7 +5253,7 @@ void save_hoard_data(void)
ifile = PHYSFS_openRead(sounds[i]);
Assert(ifile != NULL);
size = PHYSFS_fileLength(ifile);
buf = d_malloc(size);
MALLOC(buf, ubyte, size);
PHYSFS_read(ifile, buf, size, 1);
PHYSFS_writeULE32(ofile, size);
PHYSFS_write(ofile, buf, size, 1);