mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
Mod_LoadLighting: free the allocated hunk memory in case of broken or
unsupported lit file. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@360 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
0926f39da2
commit
a3c3749b98
1 changed files with 8 additions and 1 deletions
|
@ -630,7 +630,7 @@ Mod_LoadLighting -- johnfitz -- replaced with lit support code via lordhavoc
|
|||
*/
|
||||
void Mod_LoadLighting (lump_t *l)
|
||||
{
|
||||
int i;
|
||||
int i, mark;
|
||||
byte *in, *out, *data;
|
||||
byte d;
|
||||
char litfilename[1024];
|
||||
|
@ -639,6 +639,7 @@ void Mod_LoadLighting (lump_t *l)
|
|||
strcpy(litfilename, loadmodel->name);
|
||||
COM_StripExtension(litfilename, litfilename);
|
||||
strcat(litfilename, ".lit");
|
||||
mark = Hunk_LowMark();
|
||||
data = (byte*) COM_LoadHunkFile (litfilename);
|
||||
if (data)
|
||||
{
|
||||
|
@ -652,10 +653,16 @@ void Mod_LoadLighting (lump_t *l)
|
|||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_Printf("Unknown .lit file version (%d)\n", i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Hunk_FreeToLowMark(mark);
|
||||
Con_Printf("Corrupt .lit file (old version?), ignoring\n");
|
||||
}
|
||||
}
|
||||
// LordHavoc: no .lit found, expand the white lighting data to color
|
||||
if (!l->filelen)
|
||||
|
|
Loading…
Reference in a new issue