forked from bartvdbraak/blender
memory corruption error fix when changing orderU/Vs with curves, this could crash blender or make odd display lists.
the problem was that the buttons would use the first nurb if there was no 'lastnu', but the makeknots function only checked for lastnu. this meant the knots would not get re-allocated on values would be written outside the array.
This commit is contained in:
parent
055dc10c14
commit
c526b1b2df
@ -583,7 +583,7 @@ static void basisNurb(float t, short order, short pnts, float *knots, float *bas
|
||||
|
||||
/* this is for float inaccuracy */
|
||||
if(t < knots[0]) t= knots[0];
|
||||
else if(t > knots[opp2]) t= knots[opp2]; /* Valgrind reports an error here, use a nurbs torus and change u/v res to reproduce a crash TODO*/
|
||||
else if(t > knots[opp2]) t= knots[opp2];
|
||||
|
||||
/* this part is order '1' */
|
||||
o2 = order + 1;
|
||||
|
@ -3310,7 +3310,7 @@ static void editing_panel_curve_tools(Object *ob, Curve *cu)
|
||||
|
||||
if(ob==G.obedit) {
|
||||
nu= lastnu;
|
||||
if(nu==NULL) nu= editNurb.first;
|
||||
if(nu==NULL) nu= lastnu= editNurb.first;
|
||||
if(nu) {
|
||||
if (ob->type==OB_CURVE) {
|
||||
uiDefBut(block, LABEL, 0, "Tilt",
|
||||
|
Loading…
Reference in New Issue
Block a user