Added null pointer handling

This commit is contained in:
Robert Osfield
2016-06-29 17:43:37 +01:00
parent 8589d59520
commit 625c559e8d

View File

@@ -100,7 +100,9 @@ void VBSPReader::processEntities(std::istream & str, int offset,
// Parse the entities
startPtr = entities;
endPtr = strchr(entities, '}');
for (i = 0; i < numEntities; i++)
for (i = 0;
(i<numEntities) && (endPtr!=NULL && startPtr!=NULL);
i++)
{
// Get the length of this entity
entityLen = endPtr - startPtr + 1;