Merge pull request #2263 from migenius/migenius-fix-nulltexcheck

Add check for NULL texcoord values in glTF2.
pull/2253/head^2
Kim Kulling 2018-12-07 17:57:03 +01:00 committed by GitHub
commit 2f09d7f670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -439,6 +439,12 @@ 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]) {
DefaultLogger::get()->warn("NULL texcoord encountered in mesh \"" + mesh.name +
"\" and will be ignored");
continue;
}
if (attr.texcoord[tc]->count != aim->mNumVertices) {
DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name +
"\" does not match the vertex count");