Bugfix #6565
Nice discovery by Ralf (cheleb): crasher with colorband, caused by NULL pointer reading. It actually reveiled a weakness in code too, the buttonswindow context was not set appropriate when buttons window had not a header...
This commit is contained in:
@@ -292,7 +292,7 @@ int do_colorband(ColorBand *coba, float in, float out[4])
|
||||
float fac, mfac, t[4];
|
||||
int a;
|
||||
|
||||
if(coba->tot==0) return 0;
|
||||
if(coba==NULL || coba->tot==0) return 0;
|
||||
|
||||
cbd1= coba->data;
|
||||
if(coba->tot==1) {
|
||||
|
||||
@@ -698,11 +698,16 @@ void redraw_test_buttons(Object *new)
|
||||
/* callback */
|
||||
void drawbutspace(ScrArea *sa, void *spacedata)
|
||||
{
|
||||
ID *id, *idfrom;
|
||||
SpaceButs *sbuts= sa->spacedata.first;
|
||||
View2D *v2d= &sbuts->v2d;
|
||||
float col[3];
|
||||
int tab, align=0;
|
||||
|
||||
/* context */
|
||||
buttons_active_id(&id, &idfrom);
|
||||
G.buts->lockpoin= id;
|
||||
|
||||
myortho2(v2d->cur.xmin, v2d->cur.xmax, v2d->cur.ymin, v2d->cur.ymax);
|
||||
|
||||
BIF_GetThemeColor3fv(TH_BACK, col);
|
||||
|
||||
Reference in New Issue
Block a user