mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
TexturePalette: Prevent NULL dereference
Keep the app from crashing on a wad that doesn't have any palette at all.
This commit is contained in:
parent
d75f5f3f79
commit
ba508fa3e0
1 changed files with 2 additions and 2 deletions
|
@ -218,10 +218,10 @@ TEX_InitFromWad (const char *path)
|
|||
if (strcmp (lumpinfo->name, "PALETTE")) {
|
||||
lumpinfo_t tlump;
|
||||
|
||||
Sys_Printf ("TEX_InitFromWad: %s doesn't have palette as 0", path);
|
||||
Sys_Printf ("TEX_InitFromWad: %s doesn't have palette at index 0\n", path);
|
||||
lumpinfo = wad_find_lump (wad, "PALETTE");
|
||||
if (!lumpinfo)
|
||||
Sys_Printf ("TEX_InitFromWad: %s doesn't have a palette", path);
|
||||
Sys_Error ("TEX_InitFromWad: %s doesn't have a palette", path);
|
||||
|
||||
// move the palette lump to the first entry
|
||||
tlump = *lumpinfo;
|
||||
|
|
Loading…
Reference in a new issue