Browse Source

closes https://github.com/assimp/assimp/issues/1490 : fix invalid access to mesh array when the array is empty.

Kim Kulling 8 years ago
parent
commit
8be196f77d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      code/BlenderModifier.cpp

+ 3 - 1
code/BlenderModifier.cpp

@@ -310,7 +310,9 @@ void  BlenderModifier_Subdivision :: DoIt(aiNode& out, ConversionData& conv_data
 
 
     std::unique_ptr<Subdivider> subd(Subdivider::Create(algo));
     std::unique_ptr<Subdivider> subd(Subdivider::Create(algo));
     ai_assert(subd);
     ai_assert(subd);
-
+    if ( conv_data.meshes->empty() ) {
+        return;
+    }
     aiMesh** const meshes = &conv_data.meshes[conv_data.meshes->size() - out.mNumMeshes];
     aiMesh** const meshes = &conv_data.meshes[conv_data.meshes->size() - out.mNumMeshes];
     std::unique_ptr<aiMesh*[]> tempmeshes(new aiMesh*[out.mNumMeshes]());
     std::unique_ptr<aiMesh*[]> tempmeshes(new aiMesh*[out.mNumMeshes]());