- Fixed P_CheckMapData allowed non-map lump names to pass resulting in a crash when actually trying to load the map.

This commit is contained in:
Braden Obrzut 2013-08-08 23:47:58 -04:00
commit bb494292c6
3 changed files with 50 additions and 16 deletions

View file

@ -329,7 +329,15 @@ MapData *P_OpenMapData(const char * mapname)
// Since levels must be stored in WADs they can't really have full
// names and for any valid level lump this always returns the short name.
const char * lumpname = Wads.GetLumpFullName(lump_name + i);
index = GetMapIndex(mapname, index, lumpname, i != 1 || Wads.LumpLength(lump_name + i) == 0);
try
{
index = GetMapIndex(mapname, index, lumpname, true);
}
catch(...)
{
delete map;
throw;
}
if (index == ML_BEHAVIOR) map->HasBehavior = true;
// The next lump is not part of this map anymore
@ -461,7 +469,15 @@ MapData *P_OpenMapData(const char * mapname)
if (i>0)
{
index = GetMapIndex(maplabel, index, lumpname, true);
try
{
index = GetMapIndex(maplabel, index, lumpname, true);
}
catch(...)
{
delete map;
throw;
}
if (index == ML_BEHAVIOR) map->HasBehavior = true;
// The next lump is not part of this map anymore