Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Facial shapes: read the template's shape offsets in order (x86 compilers evaluated the three reads right to left, swapping x and z: CI's face tests failed on every x86 job)

islandmed95ebcffdf3cf
diff --git a/src/core/Face.cpp b/src/core/Face.cpp
index 384b8cc0..e66e97b4 100644
--- a/src/core/Face.cpp
+++ b/src/core/Face.cpp
@@ -137,7 +137,12 @@ bool parseFaceTemplate(const uint8_t* data, size_t size, FaceTemplate& out, std:
if (i >= nv) r.ok = false;
}
shape.offset.resize(count);
- for (auto& o : shape.offset) o = step * glm::vec3(float(r.get<int16_t>()), float(r.get<int16_t>()), float(r.get<int16_t>()));
+ for (auto& o : shape.offset) {
+ // One read per statement: the order function arguments are evaluated in is unspecified (x86 compilers
+ // go right to left), which swapped x and z there.
+ const float x = r.get<int16_t>(), y = r.get<int16_t>(), z = r.get<int16_t>();
+ o = step * glm::vec3(x, y, z);
+ }
t.shapes.push_back(std::move(shape));
}
if (!r.ok) {