浏览代码

SIBImporter: Add assertions to silence static analyzer warnings

Turo Lamminen 7 年之前
父节点
当前提交
e47bf932e8
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      code/SIBImporter.cpp

+ 2 - 0
code/SIBImporter.cpp

@@ -902,6 +902,7 @@ void SIBImporter::InternReadFile(const std::string& pFile,
     // Add nodes for each object.
     for (size_t n=0;n<sib.objs.size();n++)
     {
+        ai_assert(root->mChildren);
         SIBObject& obj = sib.objs[n];
         aiNode* node = new aiNode;
         root->mChildren[childIdx++] = node;
@@ -926,6 +927,7 @@ void SIBImporter::InternReadFile(const std::string& pFile,
     // (no transformation as the light is already in world space)
     for (size_t n=0;n<sib.lights.size();n++)
     {
+        ai_assert(root->mChildren);
         aiLight* light = sib.lights[n];
         if ( nullptr != light ) {
             aiNode* node = new aiNode;