- added a check to P_VerifyBlockmap to discard all blockmap with blocks whose first entry is not 0.

Seems someone has written a node builder which violates this long-standing assumption (https://www.doomworld.com/vb/source-ports/92468-introducing-zokumbsp/)
However, rather than second-guessing the format's correctness it's more advisable to just discard such blockmaps to avoid some less obvious issues that may creep up.
This commit is contained in:
Christoph Oelckers 2017-02-01 21:40:47 +01:00
parent d663f31e77
commit becc00a8be

View file

@ -2978,6 +2978,15 @@ static bool P_VerifyBlockMap(int count)
break; break;
} }
// there's some node builder which carelessly removed the initial 0-entry.
// Rather than second-guessing the intent, let's just discard such blockmaps entirely
// to be on the safe side.
if (*list != 0)
{
Printf(PRINT_HIGH, "P_VerifyBlockMap: first entry is not 0.\n");
return false;
}
// scan the list for out-of-range linedef indicies in list // scan the list for out-of-range linedef indicies in list
for(tmplist = list; *tmplist != -1; tmplist++) for(tmplist = list; *tmplist != -1; tmplist++)
{ {