Fix segfault when filename lacks extension

and don't mix up fullname with longname
This commit is contained in:
GenericHeroGuy 2025-06-27 18:01:32 +02:00
parent be35926843
commit d6299d8394
2 changed files with 2 additions and 6 deletions

View file

@ -382,11 +382,7 @@ static inline boolean CheckCompatFilename(const char *filename)
static inline boolean CheckCompatExtension(const char *filename)
{
char *basename = strrchr(filename, '.');
if (!stricmp(basename+1, "KART"))
return true;
return false;
return basename && !stricmp(basename+1, "KART");
}
static inline boolean CheckCompatSkins(UINT16 wadnum)

View file

@ -68,7 +68,7 @@ struct wadfile_t
{
char *filename;
restype_t type;
UINT32 *lumphashes; // hashes for every lump's fullname in ALL CAPS
UINT32 *lumphashes; // hashes for every lump's longname in ALL CAPS
lumpinfo_t *lumpinfo;
lumpcache_t *lumpcache;
lumpcache_t *patchcache;