diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-21 20:06:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-21 20:06:53 +0300 |
commit | a82e52102b0f7ddfe3741fccdaa9de5f480c59fe (patch) | |
tree | 22aa8ba6329b0c73c5b5f07b5a30d2fa2531d47f /source/blender/blenkernel/BKE_attribute.hh | |
parent | c1f622e63e387c70bd2577e87260b8df9a496d1d (diff) |
Mesh: Avoid uninitialized values when converting BMesh to Mesh
I didn't observe this issue in practice, but since the write_only
version of the attribute API isn't meant to initialize trivial types,
theoretically this could be a problem if the attribute is created
halfway through converting the BMesh to a Mesh.
Diffstat (limited to 'source/blender/blenkernel/BKE_attribute.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_attribute.hh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_attribute.hh b/source/blender/blenkernel/BKE_attribute.hh index 946a7d21580..b1f4039f788 100644 --- a/source/blender/blenkernel/BKE_attribute.hh +++ b/source/blender/blenkernel/BKE_attribute.hh @@ -692,6 +692,8 @@ class MutableAttributeAccessor : public AttributeAccessor { * The "only" in the name indicates that the caller should not read existing values from the * span. If the attribute is not stored as span internally, the existing values won't be copied * over to the span. + * + * For trivial types, the values in a newly created attribute will not be initialized. */ GSpanAttributeWriter lookup_or_add_for_write_only_span(const AttributeIDRef &attribute_id, const eAttrDomain domain, |