Re-expose kpzbufsiz and set it to zero in uninitengine, preventing potential crashes from successive re-initializations of the engine.

git-svn-id: https://svn.eduke32.com/eduke32@5254 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-27 08:47:03 +00:00
parent b7b23310e3
commit 410406158a
3 changed files with 3 additions and 2 deletions

View file

@ -15,6 +15,7 @@ int32_t cache1d_file_fromzip(int32_t fil);
#endif #endif
extern char *kpzbuf; extern char *kpzbuf;
extern int32_t kpzbufsiz;
extern int32_t kpzbufloadfil(int32_t); extern int32_t kpzbufloadfil(int32_t);
extern int32_t kpzbufload(const char *); extern int32_t kpzbufload(const char *);

View file

@ -56,11 +56,10 @@ static intptr_t kzipopen(const char *filnam)
#endif #endif
char *kpzbuf = NULL; char *kpzbuf = NULL;
int32_t kpzbufsiz;
int32_t kpzbufloadfil(int32_t const handle) int32_t kpzbufloadfil(int32_t const handle)
{ {
static int32_t kpzbufsiz = 0;
int32_t const leng = kfilelength(handle); int32_t const leng = kfilelength(handle);
if (leng > kpzbufsiz) if (leng > kpzbufsiz)
{ {

View file

@ -9275,6 +9275,7 @@ void uninitengine(void)
DO_FREE_AND_NULL(blockptr); DO_FREE_AND_NULL(blockptr);
#endif #endif
DO_FREE_AND_NULL(kpzbuf); DO_FREE_AND_NULL(kpzbuf);
kpzbufsiz = 0;
uninitsystem(); uninitsystem();