[Bf-blender-cvs] [256e77c987d] blender-v2.91-release: Fix T82833: GreasePencil crash when changing to Vertex Color mode

Dalai Felinto noreply at git.blender.org
Thu Nov 19 10:39:20 CET 2020


Commit: 256e77c987d2d8a3c1fc672eb75b3efe32441789
Author: Dalai Felinto
Date:   Thu Nov 19 10:33:08 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rB256e77c987d2d8a3c1fc672eb75b3efe32441789

Fix T82833: GreasePencil crash when changing to Vertex Color mode

This is actually a user interface issue, introduced on 0688309988e5.

but->tip is checked for NULL in other parts, and rightly so, since here
it crashes Blender.

On a side note I don't know how to reliably reproduce the original bug
whose fix introduced this issue. That got on the way of seeing whether
this is the correct fix, if it happens outside greasepencil operators.

Maybe it is an operator that is missing a tooltip? Impossible to tell
without more information from said commit. That said since this happened
during the end of bcon3 and we are not in bcon4 I'm going ahead with
this NULL check commit.

Patch reviewed by Philipp Oeser and Sergey Sharybin.

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

M	source/blender/editors/interface/interface_query.c

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

diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c
index d0075ba8617..83e48fad157 100644
--- a/source/blender/editors/interface/interface_query.c
+++ b/source/blender/editors/interface/interface_query.c
@@ -463,6 +463,10 @@ size_t ui_but_drawstr_len_without_sep_char(const uiBut *but)
 
 size_t ui_but_tip_len_only_first_line(const uiBut *but)
 {
+  if (but->tip == NULL) {
+    return 0;
+  }
+
   const char *str_sep = strchr(but->tip, '\n');
   if (str_sep != NULL) {
     return (str_sep - but->tip);



More information about the Bf-blender-cvs mailing list