Fix: Potential crash in mesh comparison tests with mismatched attributes
Currently we allow the before/after meshes to have different sets of attributes. But then we compare all attributes in each mesh anyway, regardless of whether they exist or not.
This commit is contained in:
@@ -522,6 +522,10 @@ static std::optional<MeshMismatch> verify_attributes_compatible(
|
||||
for (const StringRef id : mesh1_attribute_ids) {
|
||||
GAttributeReader reader1 = mesh1_attributes.lookup(id);
|
||||
GAttributeReader reader2 = mesh2_attributes.lookup(id);
|
||||
if (!reader1 || !reader2) {
|
||||
/* Necessary because of previous disabled return. */
|
||||
continue;
|
||||
}
|
||||
if (reader1.domain != reader2.domain || reader1.varray.type() != reader2.varray.type()) {
|
||||
return MeshMismatch::AttributeTypes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user