Merge pull request #3279 from assimp/migenius-migenius-fix-texcoord
add a unittest.pull/3267/head^2
commit
094b808880
|
@ -722,7 +722,7 @@ template <class T>
|
|||
void Accessor::ExtractData(T *&outData) {
|
||||
uint8_t *data = GetPointer();
|
||||
if (!data) {
|
||||
throw DeadlyImportError("GLTF: data is NULL");
|
||||
throw DeadlyImportError("GLTF2: data is nullptr.");
|
||||
}
|
||||
|
||||
const size_t elemSize = GetElementSize();
|
||||
|
|
|
@ -417,7 +417,8 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) {
|
|||
}
|
||||
for (size_t tc = 0; tc < attr.texcoord.size() && tc < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++tc) {
|
||||
if (!attr.texcoord[tc]) {
|
||||
throw DeadlyImportError("GLTF: Texture coordinate accessor not found or non-contiguous texture coordinate sets");
|
||||
DefaultLogger::get()->warn("Texture coordinate accessor not found or non-contiguous texture coordinate sets.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (attr.texcoord[tc]->count != aim->mNumVertices) {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -534,3 +534,10 @@ TEST_F(utglTF2ImportExport, norootnode_scenewithoutnodes) {
|
|||
ASSERT_NE(scene, nullptr);
|
||||
ASSERT_NE(scene->mRootNode, nullptr);
|
||||
}
|
||||
|
||||
// Shall not crash!
|
||||
TEST_F(utglTF2ImportExport, norootnode_issue_3269) {
|
||||
Assimp::Importer importer;
|
||||
const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/glTF2/issue_3269/texcoord_crash.gltf", aiProcess_ValidateDataStructure);
|
||||
ASSERT_EQ(scene, nullptr);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue