Skip to content
Permalink
Browse files

Prevent SEGV on duplicate material names with different case (#1359)

  • Loading branch information
jcaesar committed Dec 10, 2017
1 parent d94dcc8 commit be10e956986ec1c7bba946cf870e401e9fd45279
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/landscape/C4Material.cpp
@@ -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; }

0 comments on commit be10e95

Please sign in to comment.
You can’t perform that action at this time.