Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-08-29 10:56:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-08-29 10:56:19 +0400
commit1d9e69f1463f01ab2242b05cb6a0486a6f9eaeaf (patch)
treef9ca95c68436ac36ceda4f9ece0b345366d5bfc2 /source/blender/editors/interface/interface_draw.c
parent55cacb2e63e342705e25e205c1b805956a7226bd (diff)
Fix T41617: Color ramp crashes user preferences
Color ramps with no handles caused issues.
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r--source/blender/editors/interface/interface_draw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 15b8494cb34..235d7652539 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1151,9 +1151,11 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti
}
/* layer: active handle */
- cbd = &coba->data[coba->cur];
- pos = x1 + cbd->pos * (sizex - 1) + 1;
- ui_draw_colorband_handle(rect, pos, &cbd->r, display, true);
+ if (coba->tot != 0) {
+ cbd = &coba->data[coba->cur];
+ pos = x1 + cbd->pos * (sizex - 1) + 1;
+ ui_draw_colorband_handle(rect, pos, &cbd->r, display, true);
+ }
}
void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, const rcti *rect)