diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-19 01:40:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-19 01:40:06 +0400 |
commit | c846e3c750576891d3d09ad12e78e699dc91f4fe (patch) | |
tree | 0add5980a7573a9b5855372be43fed3de520a602 /source | |
parent | 116f1ae4d6e0b5e88202e8143be978a4c194bbb1 (diff) |
Fix #35014: collada import crash with UV coordinates.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/collada/MeshImporter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index c3efac55fe7..7c0c0631e7f 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -602,6 +602,8 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me) collada_meshtype == COLLADAFW::MeshPrimitive::POLYGONS || collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLES) { COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp; + unsigned int start_index = 0; + for (unsigned int j = 0; j < prim_totpoly; j++) { // Vertices in polygon: @@ -615,7 +617,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me) // get mtface by face index and uv set index MLoopUV *mloopuv = (MLoopUV *)CustomData_get_layer_n(&me->ldata, CD_MLOOPUV, uvset_index); - set_face_uv(mloopuv+loop_index, uvs, loop_index, *index_list_array[l], vcount); + set_face_uv(mloopuv+loop_index, uvs, start_index, *index_list_array[l], vcount); } if (mp_has_normals) { @@ -626,6 +628,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me) mpoly++; mloop += vcount; loop_index += vcount; + start_index += vcount; prim.totpoly++; if (mp_has_normals) |