mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 07:22:12 -05:00
Fix #128257: Crash when using Set Vertex Colors with no brush
The issue is due to a null pointer dereference in the call to `IMB_colormanagement_srgb_to_scene_linear_v3` in `vpaint_get_current_col` in `paint_vertex.cc`. `BKE_paint_brush_for_read` returns a null pointer and as a result `brush_color` points to the zero page, thus causing a null pointer dereference and hence the access violation exception. Normally, users should not be able to have no brush selected inside vertex paint mode. Instead of adding null checks everywhere, this commit protects against this case by switching the poll method to check for a brush before allowing execution. Pull Request: https://projects.blender.org/blender/blender/pulls/128260
This commit is contained in:
parent
44fbd69317
commit
8d11882d07
1 changed files with 1 additions and 1 deletions
|
@ -2320,7 +2320,7 @@ void PAINT_OT_vertex_color_set(wmOperatorType *ot)
|
|||
ot->description = "Fill the active vertex color layer with the current paint color";
|
||||
|
||||
ot->exec = vertex_color_set_exec;
|
||||
ot->poll = vertex_paint_mode_poll;
|
||||
ot->poll = vertex_paint_poll;
|
||||
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
||||
|
|
Loading…
Reference in a new issue