mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 06:32:37 +00:00
Don't fall back on allocache if malloc'ing a palookup buffer or transluc table fails.
First, it's unlikely in our day and age. Second, they're always free'd at the end, so allocache'ing them is incorrect. git-svn-id: https://svn.eduke32.com/eduke32@2570 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0be9b7e568
commit
98935fe7a9
1 changed files with 7 additions and 6 deletions
|
@ -7343,10 +7343,10 @@ static int32_t loadpalette(void)
|
|||
kread(fil,palette,768);
|
||||
kread(fil,&numshades,2); numshades = B_LITTLE16(numshades);
|
||||
|
||||
if ((palookup[0] = (char *)Bmalloc(numshades<<8)) == NULL)
|
||||
allocache((intptr_t *)&palookup[0],numshades<<8,&permanentlock);
|
||||
if ((transluc = (char *)Bmalloc(65536)) == NULL)
|
||||
allocache((intptr_t *)&transluc,65536,&permanentlock);
|
||||
palookup[0] = Bmalloc(numshades<<8);
|
||||
transluc = Bmalloc(65536);
|
||||
if (palookup[0] == NULL || transluc == NULL)
|
||||
exit(1);
|
||||
|
||||
globalpalwritten = palookup[0]; globalpal = 0;
|
||||
setpalookupaddress(globalpalwritten);
|
||||
|
@ -13434,8 +13434,9 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
|
|||
if (palookup[palnum] == NULL)
|
||||
{
|
||||
//Allocate palookup buffer
|
||||
if ((palookup[palnum] = (char *)Bmalloc(numshades<<8)) == NULL)
|
||||
allocache((intptr_t *)&palookup[palnum],numshades<<8,&permanentlock);
|
||||
palookup[palnum] = Bmalloc(numshades<<8);
|
||||
if (palookup[palnum] == NULL)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (dastat == 0) return;
|
||||
|
|
Loading…
Reference in a new issue