mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-04 18:40:51 +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
8f92076b32
commit
92b735fe40
1 changed files with 2 additions and 2 deletions
|
@ -218,10 +218,10 @@ TEX_InitFromWad (const char *path)
|
||||||
if (strcmp (lumpinfo->name, "PALETTE")) {
|
if (strcmp (lumpinfo->name, "PALETTE")) {
|
||||||
lumpinfo_t tlump;
|
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");
|
lumpinfo = wad_find_lump (wad, "PALETTE");
|
||||||
if (!lumpinfo)
|
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
|
// move the palette lump to the first entry
|
||||||
tlump = *lumpinfo;
|
tlump = *lumpinfo;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue