diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-06-20 13:34:35 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-06-20 13:34:35 +0400 |
commit | dbe7488c43bf5be76f7ab9be8951c3f1af96b002 (patch) | |
tree | 0f58f1666bdd9a54eabe17143de6548b8e0ec2f7 /source/blender/collada/MeshImporter.cpp | |
parent | c27fa83cf7893a824a2a72fae195989283aeebdb (diff) |
Fix [#27474] Blender crashes on collada import if input_set is missing
reported by Rebin Cornelius.
This needs patch from upstream report http://code.google.com/p/opencollada/issues/list?thanks=164 applied to OpenCOLLADA. lib/windows/collada and lib/win64/collada have already been updated. Ensures we don't read past array boundaries.
Diffstat (limited to 'source/blender/collada/MeshImporter.cpp')
-rw-r--r-- | source/blender/collada/MeshImporter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index b6576858c51..806be14d0ed 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -755,9 +755,11 @@ MTex *MeshImporter::assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBindi MTex *color_texture) { const COLLADAFW::TextureMapId texture_index = ctexture.getTextureMapId(); - const size_t setindex = ctexture.getSetIndex(); + size_t setindex = ctexture.getSetIndex(); std::string uvname = ctexture.getSemantic(); + if(setindex==-1) return NULL; + const CustomData *data = &me->fdata; int layer_index = CustomData_get_layer_index(data, CD_MTFACE); CustomDataLayer *cdl = &data->layers[layer_index+setindex]; |