Commit: 817e2796cbe4c6e115c8a4b6bf535017043be930
Author: Sybren A. Stüvel
Date:   Tue Jul 9 16:22:52 2019 +0200
Branches: master
https://developer.blender.org/rB817e2796cbe4c6e115c8a4b6bf535017043be930

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.

===================================================================

M       source/blender/alembic/intern/abc_mesh.cc

===================================================================

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<Imath::V3f> points, normals;
   std::vector<int32_t> poly_verts, loop_counts;
+  std::vector<Imath::V3f> velocities;
 
   bool smooth_normal = false;
 
@@ -458,9 +459,7 @@ void AbcGenericMeshWriter::writeMesh(struct Mesh *mesh)
   }
 
   if (m_is_liquid) {
-    std::vector<Imath::V3f> velocities;
     getVelocities(mesh, velocities);
-
     m_mesh_sample.setVelocities(V3fArraySample(velocities));
   }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to