Fixes issues our internal compliance and code quality tool found:

* Adds nullptr checks and asserts to protect certain code paths
* Fixes wrong integer type in a printf call
* Adds const to const values
* Prevents integer overflow with explicit casts
This commit is contained in:
Max Vollmer (Microsoft Havok)
2021-08-30 14:59:17 +01:00
parent 5e86fead8e
commit 51f294c587
7 changed files with 19 additions and 8 deletions

View File

@@ -89,6 +89,9 @@ void ScenePreprocessor::ProcessScene() {
ASSIMP_LOG_DEBUG("ScenePreprocessor: Adding default material \'" AI_DEFAULT_MATERIAL_NAME "\'");
for (unsigned int i = 0; i < scene->mNumMeshes; ++i) {
if (nullptr == scene->mMeshes[i]) {
continue;
}
scene->mMeshes[i]->mMaterialIndex = scene->mNumMaterials;
}