瀏覽代碼

NFF: Add assertions to silence static analyzer warnings

Turo Lamminen 7 年之前
父節點
當前提交
f90019bc1e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      code/NFFLoader.cpp

+ 2 - 0
code/NFFLoader.cpp

@@ -1079,6 +1079,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
     // generate the camera
     // generate the camera
     if (hasCam)
     if (hasCam)
     {
     {
+        ai_assert(ppcChildren);
         aiNode* nd = new aiNode();
         aiNode* nd = new aiNode();
         *ppcChildren = nd;
         *ppcChildren = nd;
         nd->mName.Set("<NFF_Camera>");
         nd->mName.Set("<NFF_Camera>");
@@ -1104,6 +1105,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
     // generate light sources
     // generate light sources
     if (!lights.empty())
     if (!lights.empty())
     {
     {
+        ai_assert(ppcChildren);
         pScene->mNumLights = (unsigned int)lights.size();
         pScene->mNumLights = (unsigned int)lights.size();
         pScene->mLights = new aiLight*[pScene->mNumLights];
         pScene->mLights = new aiLight*[pScene->mNumLights];
         for (unsigned int i = 0; i < pScene->mNumLights;++i,++ppcChildren)
         for (unsigned int i = 0; i < pScene->mNumLights;++i,++ppcChildren)