Fix for uninitialized memory use in Cycles

This commit is contained in:
Campbell Barton 2014-05-21 15:37:18 +10:00
parent 628353835c
commit b1350cf392

@ -263,11 +263,19 @@ Attribute *AttributeSet::add(ustring name, TypeDesc type, AttributeElement eleme
remove(name);
}
attributes.push_back(Attribute());
#if __cplusplus >= 201103L
attributes.emplace_back();
attr = &attributes.back();
attr->set(name, type, element);
#else
{
Attribute attr_temp;
attr_temp.set(name, type, element);
attributes.push_back(attr_temp);
attr = &attributes.back();
}
#endif
/* this is weak .. */
if(triangle_mesh)
attr->reserve(triangle_mesh->verts.size(), triangle_mesh->triangles.size(), triangle_mesh->motion_steps, 0, 0, resize);