summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-02-16 12:45:18 +0100
committerGitHub <noreply@github.com>2019-02-16 12:45:18 +0100
commit2293559c9f59c1bc3016d8aec1e0c412bc415eb0 (patch)
tree3b685faef4f67ce355535a2b4ec23479f306820b /scene
parentf5477ee36f2d34a5d6db0ee3e1516e9c12be28d5 (diff)
parent7ae160f6618848648be34ab2c1ac8768cd6c894e (diff)
Merge pull request #25888 from marxin/fix-25217-part-2
Fix 2 more UBSAN issues (#25217).
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/mesh.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index 805d30245a..a9878ef5c1 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -787,7 +787,6 @@ void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &
Surface s;
VisualServer::get_singleton()->mesh_add_surface_from_arrays(mesh, (VisualServer::PrimitiveType)p_primitive, p_arrays, p_blend_shapes, p_flags);
- surfaces.push_back(s);
/* make aABB? */ {
@@ -808,8 +807,9 @@ void ArrayMesh::add_surface_from_arrays(PrimitiveType p_primitive, const Array &
aabb.expand_to(vtx[i]);
}
- surfaces.write[surfaces.size() - 1].aabb = aabb;
- surfaces.write[surfaces.size() - 1].is_2d = arr.get_type() == Variant::POOL_VECTOR2_ARRAY;
+ s.aabb = aabb;
+ s.is_2d = arr.get_type() == Variant::POOL_VECTOR2_ARRAY;
+ surfaces.push_back(s);
_recompute_aabb();
}