mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-23 15:40:39 +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,palette,768);
|
||||||
kread(fil,&numshades,2); numshades = B_LITTLE16(numshades);
|
kread(fil,&numshades,2); numshades = B_LITTLE16(numshades);
|
||||||
|
|
||||||
if ((palookup[0] = (char *)Bmalloc(numshades<<8)) == NULL)
|
palookup[0] = Bmalloc(numshades<<8);
|
||||||
allocache((intptr_t *)&palookup[0],numshades<<8,&permanentlock);
|
transluc = Bmalloc(65536);
|
||||||
if ((transluc = (char *)Bmalloc(65536)) == NULL)
|
if (palookup[0] == NULL || transluc == NULL)
|
||||||
allocache((intptr_t *)&transluc,65536,&permanentlock);
|
exit(1);
|
||||||
|
|
||||||
globalpalwritten = palookup[0]; globalpal = 0;
|
globalpalwritten = palookup[0]; globalpal = 0;
|
||||||
setpalookupaddress(globalpalwritten);
|
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)
|
if (palookup[palnum] == NULL)
|
||||||
{
|
{
|
||||||
//Allocate palookup buffer
|
//Allocate palookup buffer
|
||||||
if ((palookup[palnum] = (char *)Bmalloc(numshades<<8)) == NULL)
|
palookup[palnum] = Bmalloc(numshades<<8);
|
||||||
allocache((intptr_t *)&palookup[palnum],numshades<<8,&permanentlock);
|
if (palookup[palnum] == NULL)
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dastat == 0) return;
|
if (dastat == 0) return;
|
||||||
|
|
Loading…
Reference in a new issue