From ba508fa3e0d723b4a9cbc9ebbff4f0ff6b8e324a Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Sun, 10 Oct 2010 01:51:22 -0400 Subject: [PATCH] TexturePalette: Prevent NULL dereference Keep the app from crashing on a wad that doesn't have any palette at all. --- tools/Forge/Bundles/MapEdit/TexturePalette.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Forge/Bundles/MapEdit/TexturePalette.m b/tools/Forge/Bundles/MapEdit/TexturePalette.m index 35d57f87e..0049805c9 100644 --- a/tools/Forge/Bundles/MapEdit/TexturePalette.m +++ b/tools/Forge/Bundles/MapEdit/TexturePalette.m @@ -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;