mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Avoid triggering undefined behavior in the allocator when loading or saving ProjectileData[].
git-svn-id: https://svn.eduke32.com/eduke32@5111 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d49987d3cb
commit
9cf7da4366
1 changed files with 4 additions and 2 deletions
|
@ -1724,6 +1724,7 @@ static void sv_quoteload()
|
|||
|
||||
static void sv_preprojectilesave()
|
||||
{
|
||||
if (ProjectileData != NULL || g_numProjectiles > 0)
|
||||
ProjectileData = (projectile_t *) Xrealloc(ProjectileData, sizeof(projectile_t) * g_numProjectiles);
|
||||
#ifdef DEBUGGINGAIDS
|
||||
int onumprojectiles = g_numProjectiles;
|
||||
|
@ -1752,6 +1753,7 @@ static void sv_postprojectilesave()
|
|||
|
||||
static void sv_preprojectileload()
|
||||
{
|
||||
if (ProjectileData != NULL || g_numProjectiles > 0)
|
||||
ProjectileData = (projectile_t *) Xrealloc(ProjectileData, sizeof(projectile_t) * g_numProjectiles);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue