[Bf-blender-cvs] [8c0dea72b67] master: Fix segfault when polling OBJECT_OT_voxel_remesh without active object

Sybren A. Stüvel noreply at git.blender.org
Wed Sep 18 10:24:39 CEST 2019


Commit: 8c0dea72b6791a07100487de556ab352106f7f44
Author: Sybren A. Stüvel
Date:   Tue Sep 17 17:08:51 2019 +0200
Branches: master
https://developer.blender.org/rB8c0dea72b6791a07100487de556ab352106f7f44

Fix segfault when polling OBJECT_OT_voxel_remesh without active object

The active object can be `NULL`, which causes a segfault in
`BKE_object_is_in_editmode(NULL)` (and if that were made NULL-safe, the
segfault would happen further down in `object_remesh_poll()`).

===================================================================

M	source/blender/editors/object/object_remesh.c

===================================================================

diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c
index 815cc618d4b..393f63d2177 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -73,6 +73,10 @@ static bool object_remesh_poll(bContext *C)
 {
   Object *ob = CTX_data_active_object(C);
 
+  if (ob == NULL) {
+    return false;
+  }
+
   if (BKE_object_is_in_editmode(ob)) {
     CTX_wm_operator_poll_msg_set(C, "The voxel remesher cannot run from edit mode.");
     return false;



More information about the Bf-blender-cvs mailing list