Bug: Export crashes when any of the meshes contains texture coordinate names #4243

This commit is contained in:
kovacsv
2021-12-07 20:42:43 +01:00
parent 70f5cca9c3
commit 2be6bac4b0
3 changed files with 38 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "UnitTestPCH.h"
#include <assimp/scene.h>
#include <assimp/SceneCombiner.h>
using namespace Assimp;
@@ -88,5 +89,21 @@ TEST_F(utScene, getShortFilenameTest) {
EXPECT_NE(nullptr, name2);
}
TEST_F(utScene, deepCopyTest) {
scene->mRootNode = new aiNode();
scene->mNumMeshes = 1;
scene->mMeshes = new aiMesh *[scene->mNumMeshes] ();
scene->mMeshes[0] = new aiMesh ();
scene->mMeshes[0]->SetTextureCoordsName (0, aiString ("test"));
{
aiScene* copied = nullptr;
SceneCombiner::CopyScene(&copied,scene);
delete copied;
}
}
TEST_F(utScene, getEmbeddedTextureTest) {
}