From 817e2796cbe4c6e115c8a4b6bf535017043be930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 9 Jul 2019 16:22:52 +0200 Subject: Fix T52814 and T58686: Alembic crashing on fluid sim export The velocities std::vector was allocated in too narrow a scope, causing use-after-free errors. --- source/blender/alembic/intern/abc_mesh.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 7f7afe0ce5e..0ff3360d644 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -409,6 +409,7 @@ void AbcGenericMeshWriter::writeMesh(struct Mesh *mesh) { std::vector points, normals; std::vector poly_verts, loop_counts; + std::vector velocities; bool smooth_normal = false; @@ -458,9 +459,7 @@ void AbcGenericMeshWriter::writeMesh(struct Mesh *mesh) } if (m_is_liquid) { - std::vector velocities; getVelocities(mesh, velocities); - m_mesh_sample.setVelocities(V3fArraySample(velocities)); } -- cgit v1.2.3