From 61efaec1730847dde5b407d6052d543a6cdd079b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Thu, 15 Jun 2023 14:00:24 +0200 Subject: [PATCH] Fix Alembic crash when importing a SubD mesh The counters for polygons count and face corners count were inverted, leading to various out of bounds accesses due to wrong data size allocation. Not sure where the bug comes from, whether it's original, or a typo from some refactor. --- source/blender/io/alembic/intern/abc_reader_mesh.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index 781369a8816..fa1624f643d 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -1133,7 +1133,7 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh, if (existing_mesh->totvert != positions->size()) { new_mesh = BKE_mesh_new_nomain_from_template( - existing_mesh, positions->size(), 0, face_indices->size(), face_counts->size()); + existing_mesh, positions->size(), 0, face_counts->size(), face_indices->size()); settings.read_flag |= MOD_MESHSEQ_READ_ALL; }