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
This commit is contained in:
@@ -1911,9 +1911,11 @@ void BKE_paint_copy(const Paint *src, Paint *dst, const int flag)
|
||||
}
|
||||
|
||||
dst->runtime = MEM_new<blender::bke::PaintRuntime>(__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<void(Paint *paint)> fn)
|
||||
|
||||
Reference in New Issue
Block a user