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:
Jeff Teunissen 2010-10-10 01:51:22 -04:00 committed by Bill Currie
parent d75f5f3f79
commit ba508fa3e0
1 changed files with 2 additions and 2 deletions

View File

@ -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;