浏览代码

Merge pull request #4832 from assimp/kimkulling/fix_heap_overflow_issue-4831

Ensure face pointer is not nullptr
Kim Kulling 2 年之前
父节点
当前提交
b2b85bf971
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      code/Common/ScenePreprocessor.cpp

+ 1 - 0
code/Common/ScenePreprocessor.cpp

@@ -142,6 +142,7 @@ void ScenePreprocessor::ProcessMesh(aiMesh *mesh) {
     // If the information which primitive types are there in the
     // If the information which primitive types are there in the
     // mesh is currently not available, compute it.
     // mesh is currently not available, compute it.
     if (!mesh->mPrimitiveTypes) {
     if (!mesh->mPrimitiveTypes) {
+        ai_assert(mesh->mFaces != nullptr);
         for (unsigned int a = 0; a < mesh->mNumFaces; ++a) {
         for (unsigned int a = 0; a < mesh->mNumFaces; ++a) {
             aiFace &face = mesh->mFaces[a];
             aiFace &face = mesh->mFaces[a];
             switch (face.mNumIndices) {
             switch (face.mNumIndices) {