Browse Source

Merge pull request #3997 from assimp/issue_3957

closes https://github.com/assimp/assimp/issues/3957: checkj for empty…
Kim Kulling 4 năm trước cách đây
mục cha
commit
26538a4f4a

+ 4 - 0
code/AssetLib/Collada/ColladaLoader.cpp

@@ -619,6 +619,10 @@ aiMesh *ColladaLoader::CreateMesh(const ColladaParser &pParser, const Mesh *pSrc
         dstMesh->mName = pSrcMesh->mId;
         dstMesh->mName = pSrcMesh->mId;
     }
     }
 
 
+    if (pSrcMesh->mPositions.empty()) {
+        return dstMesh.release();
+    }
+
     // count the vertices addressed by its faces
     // count the vertices addressed by its faces
     const size_t numVertices = std::accumulate(pSrcMesh->mFaceSize.begin() + pStartFace,
     const size_t numVertices = std::accumulate(pSrcMesh->mFaceSize.begin() + pStartFace,
             pSrcMesh->mFaceSize.begin() + pStartFace + pSubMesh.mNumFaces, size_t(0));
             pSrcMesh->mFaceSize.begin() + pStartFace + pSubMesh.mNumFaces, size_t(0));