Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2020-09-09 17:03:19 +0300
committerSebastian Parborg <darkdefende@gmail.com>2020-09-09 17:19:52 +0300
commit8bead3df2ffef1fa249b8c852b03cfcca2400c3d (patch)
tree73f864cfa5b3cb27cba86b1700edf24573a72d7a /source/blender/editors/space_buttons/buttons_context.c
parent5c0eda51ffe5e312077b71b8972fbaef0c3a257b (diff)
Fix material null pointer reference in buttons_context.c
ASAN reported null pointer access when converting a mesh to curves. Check if the material is a null pointer before trying to use it.
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_context.c')
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index e567b3ca54c..2cfda8644df 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -333,6 +333,9 @@ static bool buttons_context_path_material(ButsContextPath *path)
if (ob && OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
ma = BKE_object_material_get(ob, ob->actcol);
+ if (ma == NULL) {
+ return false;
+ }
RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
path->len++;
return true;