From bbfcffb54d9f4e6c520e954afe3b48a14a252018 Mon Sep 17 00:00:00 2001 From: Falk David Date: Sat, 4 Oct 2025 06:39:37 +0200 Subject: [PATCH] Fix #147294: Crash when duplicating scene strip Seems to have been introduced by 1104c69a0e. In `BKE_paint_copy` the `src->runtime` can be `nullptr` in some cases. This adds a check to make sure to only copy the settings when `src->runtime` exists. Pull Request: https://projects.blender.org/blender/blender/pulls/147304 --- source/blender/blenkernel/intern/paint.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc index 95ee482eb1d..3207b198db1 100644 --- a/source/blender/blenkernel/intern/paint.cc +++ b/source/blender/blenkernel/intern/paint.cc @@ -1911,9 +1911,11 @@ void BKE_paint_copy(const Paint *src, Paint *dst, const int flag) } dst->runtime = MEM_new(__func__); - dst->runtime->paint_mode = src->runtime->paint_mode; - dst->runtime->ob_mode = src->runtime->ob_mode; - dst->runtime->initialized = true; + if (src->runtime) { + dst->runtime->paint_mode = src->runtime->paint_mode; + dst->runtime->ob_mode = src->runtime->ob_mode; + dst->runtime->initialized = true; + } } void BKE_paint_settings_foreach_mode(ToolSettings *ts, blender::FunctionRef fn)