Fix T87056: Segfault in GPU_batch_clear() involing Lattice evaluation

Fix a segfault by setting the `batch_cache` pointer to `NULL` when copying
a Lattice. That way the copy can get its own batch cache when needed,
preventing a use-after-free.
This commit is contained in:
Sybren A. Stüvel 2021-04-01 12:28:26 +02:00
parent d904271d09
commit 64538532d4
Notes: blender-bot 2023-02-14 09:19:09 +01:00
Referenced by issue #87056, Segfault in GPU_batch_clear() involing Lattice evaluation
1 changed files with 1 additions and 0 deletions

View File

@ -94,6 +94,7 @@ static void lattice_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const i
}
lattice_dst->editlatt = NULL;
lattice_dst->batch_cache = NULL;
}
static void lattice_free_data(ID *id)