When setting a bogus sound in gamedata_read_tbl, don't let piggy_close free it. Fixes freeing of non-malloc'd pointer for PC shareware data
This commit is contained in:
parent
f0c4d80f48
commit
f4ec76d74d
|
@ -1,5 +1,9 @@
|
||||||
D1X-Rebirth Changelog
|
D1X-Rebirth Changelog
|
||||||
|
|
||||||
|
20101204
|
||||||
|
--------
|
||||||
|
main/bmread.c, main/piggy.c: When setting a bogus sound in gamedata_read_tbl, don't let piggy_close free it. Fixes freeing of non-malloc'd pointer for PC shareware data
|
||||||
|
|
||||||
20101203
|
20101203
|
||||||
--------
|
--------
|
||||||
main/net_udp.c: Made resent_delay for net_udp_noloss_process_queue() a bit longer depending on the player's ping
|
main/net_udp.c: Made resent_delay for net_udp_noloss_process_queue() a bit longer depending on the player's ping
|
||||||
|
|
|
@ -285,7 +285,9 @@ int ds_load(int skip, char * filename ) {
|
||||||
char rawname[100];
|
char rawname[100];
|
||||||
|
|
||||||
if (skip) {
|
if (skip) {
|
||||||
return piggy_register_sound( &bogus_sound, "bogus", 0 );
|
// We tell piggy_register_sound it's in the pig file, when in actual fact it's in no file
|
||||||
|
// This just tells piggy_close not to attempt to free it
|
||||||
|
return piggy_register_sound( &bogus_sound, "bogus", 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
removeext( filename, fname );
|
removeext( filename, fname );
|
||||||
|
|
|
@ -211,6 +211,8 @@ int piggy_register_sound( digi_sound * snd, char * name, int in_file )
|
||||||
if ( !in_file ) {
|
if ( !in_file ) {
|
||||||
SoundOffset[Num_sound_files] = 0;
|
SoundOffset[Num_sound_files] = 0;
|
||||||
}
|
}
|
||||||
|
else if (SoundOffset[Num_sound_files] == 0)
|
||||||
|
SoundOffset[Num_sound_files] = -1; // make sure this sound's data is not individually freed
|
||||||
|
|
||||||
i = Num_sound_files;
|
i = Num_sound_files;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue