Prevent nullptr access to normals-array in bitangent computation
parent
19f2a624a9
commit
537c46a42a
|
@ -606,7 +606,10 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (needTangents) {
|
if (needTangents) {
|
||||||
if (target.tangent[0]->count != aim->mNumVertices) {
|
if (!aiAnimMesh.HasNormals()) {
|
||||||
|
// prevent nullptr access to aiAnimMesh.mNormals below when no normals are available
|
||||||
|
ASSIMP_LOG_WARN("Bitangents of target ", i, " in mesh \"", mesh.name, "\" can't be computed, because mesh has no normals.");
|
||||||
|
} else if (target.tangent[0]->count != aim->mNumVertices) {
|
||||||
ASSIMP_LOG_WARN("Tangents of target ", i, " in mesh \"", mesh.name, "\" does not match the vertex count");
|
ASSIMP_LOG_WARN("Tangents of target ", i, " in mesh \"", mesh.name, "\" does not match the vertex count");
|
||||||
} else {
|
} else {
|
||||||
Tangent *tangent = nullptr;
|
Tangent *tangent = nullptr;
|
||||||
|
|
Loading…
Reference in New Issue