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

@ -770,6 +770,8 @@ static void conditioner_createDefaultClip(domCOLLADA* root)
static void conditioner_fixupAnimation(domAnimation* anim)
{
S32 visibilityLen = dStrlen("/visibility");
for (S32 iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) {
// Get the animation elements: <channel>, <sampler>
@ -815,7 +817,7 @@ static void conditioner_fixupAnimation(domAnimation* anim)
// Get parent SID string
char *parentSID = dStrdup(channel->getTarget());
parentSID[dStrlen(parentSID) - dStrlen("/visibility")] = '\0';
parentSID[dStrlen(parentSID) - visibilityLen] = '\0';
// Find the parent element (should be a <node>)
daeSIDResolver parentResolver(channel, parentSID);
@ -3039,4 +3041,4 @@ void ColladaUtils::ExportData::processData()
}
}
}
}
}