diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp index 15c338716..39587edbd 100644 --- a/code/glTF2Importer.cpp +++ b/code/glTF2Importer.cpp @@ -436,6 +436,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]->count != aim->mNumVertices) { + DefaultLogger::get()->warn("Texcoord stream size in mesh \"" + mesh.name + + "\" does not match the vertex count"); + continue; + } + attr.texcoord[tc]->ExtractData(aim->mTextureCoords[tc]); aim->mNumUVComponents[tc] = attr.texcoord[tc]->GetNumComponents();