From 8be196f77de94e42456b2fa39511b037181e0a77 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 31 Oct 2017 14:03:03 +0100 Subject: [PATCH] closes https://github.com/assimp/assimp/issues/1490 : fix invalid access to mesh array when the array is empty. --- code/BlenderModifier.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/BlenderModifier.cpp b/code/BlenderModifier.cpp index a1ccba5f4..348df1f48 100644 --- a/code/BlenderModifier.cpp +++ b/code/BlenderModifier.cpp @@ -310,7 +310,9 @@ void BlenderModifier_Subdivision :: DoIt(aiNode& out, ConversionData& conv_data std::unique_ptr subd(Subdivider::Create(algo)); ai_assert(subd); - + if ( conv_data.meshes->empty() ) { + return; + } aiMesh** const meshes = &conv_data.meshes[conv_data.meshes->size() - out.mNumMeshes]; std::unique_ptr tempmeshes(new aiMesh*[out.mNumMeshes]());