[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26842] trunk/blender/source/blender/ editors/interface/interface.c: fix use of uninitialized vars with the color wheel.
Campbell Barton
ideasman42 at gmail.com
Fri Feb 12 15:34:08 CET 2010
Revision: 26842
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26842
Author: campbellbarton
Date: 2010-02-12 15:34:08 +0100 (Fri, 12 Feb 2010)
Log Message:
-----------
fix use of uninitialized vars with the color wheel.
Modified Paths:
--------------
trunk/blender/source/blender/editors/interface/interface.c
Modified: trunk/blender/source/blender/editors/interface/interface.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface.c 2010-02-12 13:34:04 UTC (rev 26841)
+++ trunk/blender/source/blender/editors/interface/interface.c 2010-02-12 14:34:08 UTC (rev 26842)
@@ -1189,6 +1189,12 @@
float *fp= (float *)but->poin;
VECCOPY(vec, fp);
}
+ else {
+ if (but->editvec==NULL) {
+ fprintf(stderr, "ui_get_but_vectorf: can't get color, should never happen\n");
+ vec[0]= vec[1]= vec[2]= 0.0f;
+ }
+ }
}
/* for buttons pointing to color for example */
@@ -2096,6 +2102,15 @@
strncpy(but->drawstr+2, but->str, UI_MAX_DRAW_STR-2);
}
break;
+
+ case HSVCUBE:
+ case HSVCIRCLE:
+ {
+ float rgb[3];
+ ui_get_but_vectorf(but, rgb);
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2);
+ }
+ break;
default:
strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR);
@@ -2361,14 +2376,7 @@
}
}
}
-
- if(ELEM(but->type, HSVCUBE, HSVCIRCLE)) { /* hsv buttons temp storage */
- float rgb[3];
- ui_get_but_vectorf(but, rgb);
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2);
- }
-
if((block->flag & UI_BLOCK_LOOP) || ELEM7(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU))
but->flag |= (UI_TEXT_LEFT|UI_ICON_LEFT);
else if(but->type==BUT_TOGDUAL)
More information about the Bf-blender-cvs
mailing list