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:
Ton Roosendaal
2007-04-16 10:55:59 +00:00
parent 41142b05d2
commit 3f7bcc44ce
2 changed files with 6 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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);