Various misc. tweaks and fixes based on static code analysis to minimize/fix memleaks, crashes, or other performance impacting code.

This commit is contained in:
Areloch 2020-09-19 18:25:10 -05:00
parent d76c73c252
commit 8956559bfd
44 changed files with 124 additions and 258 deletions

View file

@ -120,6 +120,7 @@ bool CustomMaterial::onAdd()
}
const char* samplerDecl = "sampler";
S32 samplerDeclLen = dStrlen(samplerDecl);
S32 i = 0;
for (SimFieldDictionaryIterator itr(getFieldDictionary()); *itr; ++itr)
{
@ -132,7 +133,7 @@ bool CustomMaterial::onAdd()
return false;
}
if (dStrlen(entry->slotName) == dStrlen(samplerDecl))
if (dStrlen(entry->slotName) == samplerDeclLen)
{
logError("sampler declarations must have a sampler name, e.g. sampler[\"diffuseMap\"]");
return false;
@ -140,7 +141,7 @@ bool CustomMaterial::onAdd()
// Assert sampler names are defined on ShaderData
S32 pos = -1;
String samplerName = entry->slotName + dStrlen(samplerDecl);
String samplerName = entry->slotName + samplerDeclLen;
samplerName.insert(0, '$');
mShaderData->hasSamplerDef(samplerName, pos);