diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-12-29 23:37:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-12-30 00:13:15 +0300 |
commit | d993bad5e7adc35ad984dec1bbf0a57d99000712 (patch) | |
tree | 1940539860711d3f1a5a689cb94d158153eff673 /source/blender/editors/interface/interface_utils.c | |
parent | 4748e3464221a6bdee8d036633f8b53f4279b3ff (diff) |
Fix possible NULL pointer dereference
also remove redundant NULL check
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r-- | source/blender/editors/interface/interface_utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index c083a280763..28bd637ae59 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -83,8 +83,12 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind int arraylen = RNA_property_array_length(ptr, prop); if (arraylen && index == -1) { - if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) + if (ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) { but = uiDefButR_prop(block, UI_BTYPE_COLOR, 0, name, x1, y1, x2, y2, ptr, prop, -1, 0, 0, -1, -1, NULL); + } + else { + return NULL; + } } else if (RNA_property_subtype(prop) == PROP_PERCENTAGE || RNA_property_subtype(prop) == PROP_FACTOR) but = uiDefButR_prop(block, UI_BTYPE_NUM_SLIDER, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); |