mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Cheap fix for load game menu crash
git-svn-id: https://svn.eduke32.com/eduke32@6957 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c5054af778
commit
ddd8b7e5bb
1 changed files with 9 additions and 2 deletions
|
@ -205,7 +205,10 @@ static void ReadSaveGameHeaders_Internal(void)
|
|||
// potentially overallocating but programmatically simple
|
||||
size_t const numfiles = countcache1dfind(findfiles_default);
|
||||
size_t const internalsavesize = sizeof(menusave_t) * numfiles;
|
||||
|
||||
g_internalsaves = (menusave_t *)Xrealloc(g_internalsaves, internalsavesize);
|
||||
|
||||
if (internalsavesize)
|
||||
g_internalsaves->clear();
|
||||
|
||||
g_numinternalsaves = 0;
|
||||
|
@ -222,8 +225,12 @@ static void ReadSaveGameHeaders_Internal(void)
|
|||
}
|
||||
}
|
||||
size_t const menusavesize = sizeof(menusave_t) * g_nummenusaves;
|
||||
|
||||
g_menusaves = (menusave_t *)Xrealloc(g_menusaves, menusavesize);
|
||||
|
||||
if (menusavesize)
|
||||
g_menusaves->clear();
|
||||
|
||||
for (size_t x = g_numinternalsaves-1, y = 0; x < g_numinternalsaves; --x)
|
||||
{
|
||||
menusave_t & msv = g_internalsaves[x];
|
||||
|
|
Loading…
Reference in a new issue