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.
This commit is contained in:
Nathan Letwory
2011-06-20 09:34:35 +00:00
parent c27fa83cf7
commit dbe7488c43

View File

@@ -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];