Navigation Menu

Skip to content

Commit

Permalink
Prevent SEGV on duplicate material names with different case (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaesar committed Dec 10, 2017
1 parent d94dcc8 commit be10e95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/landscape/C4Material.cpp
Expand Up @@ -331,6 +331,10 @@ int32_t C4MaterialMap::Load(C4Group &hGroup)
hGroup.ResetSearch(); int32_t cnt=0;
while (hGroup.FindNextEntry(C4CFN_MaterialFiles,entryname))
{
if (cnt >= mat_num) {
Log("Internal Error: More materials loaded than expected. Make sure your material file names are unique (ignoring case).");
break;
}
// Load mat
if (!pNewMap[cnt].Load(hGroup,entryname))
{ delete [] pNewMap; return 0; }
Expand Down

0 comments on commit be10e95

Please sign in to comment.