From 64538532d44d35c109dc4c82e11c4e173f5f29a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 1 Apr 2021 12:28:26 +0200 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/lattice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index 48104e72825..1357424d5ff 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -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)