Fix #104358: Crash with broken writing to freed evaluated mesh #104835

Closed
Hans Goudey wants to merge 2 commits from HooglyBoogly:fix-crash-absolutely-broken-fix-deforms-op into blender-v3.5-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

2 Commits

Author SHA1 Message Date
Hans Goudey c9d7935272 Fix #104358: Crash with broken writing to freed evaluated mesh
For some reason that I have no idea about, the "Fix Deforms" operator
retrieved the evaluated mesh, wrote to its vertex group data, undid
that write, and then freed the evaluated mesh, and then tried to do
that again, resulting in a use-after free.

This operator is a huge mess and I have no idea what its goal is, but
this change fixes the crash by simply removing the no-op writing.
Ideally the entire operator should be rewritten or removed,
since the code is suspect in many other ways.
2023-02-16 12:46:42 -05:00
Hans Goudey 26a362b9d7 Fix: Avoid using spans of freed meshes
I'm not observing a crash from this, but since the deformed mesh
is reassigned, we need to retrieve the positions array again.
This changes the logic to what it was before 05952aa94d.
2023-02-16 12:43:57 -05:00