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.
This commit is contained in:
Sybren A. Stüvel 2019-07-09 16:22:52 +02:00
parent 6510ab8676
commit 817e2796cb
Notes: blender-bot 2023-02-14 06:54:28 +01:00
Referenced by issue #58686, Blender 2.8 Crashing on Alembic export of fluid animation past 80 frames
Referenced by issue #52814, Alembic export with fluid simulation (resolution 250) causes Blender to close down with  no errors
1 changed files with 1 additions and 2 deletions

View File

@ -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));
}