Fix uvsculpt null pointer reference in paint.c

ASAN reported null pointer access when going into edit mode on the
default cube.

Check in uvculpt has been initialized before trying to use it.
This commit is contained in:
Sebastian Parborg
2020-09-09 16:05:19 +02:00
parent 8bead3df2f
commit fe8509af61

View File

@@ -406,7 +406,7 @@ Paint *BKE_paint_get_active(Scene *sce, ViewLayer *view_layer)
case OB_MODE_WEIGHT_GPENCIL:
return &ts->gp_weightpaint->paint;
case OB_MODE_EDIT:
return &ts->uvsculpt->paint;
return ts->uvsculpt ? &ts->uvsculpt->paint : NULL;
default:
break;
}