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>2008-05-18 22:44:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-05-18 22:44:02 +0400
commitc526b1b2df09211bead73a7297992a002dc787e4 (patch)
treeb1e7da1698d9e579d2fd1918acda6c1a66d8f5ad
parent055dc10c14368ddb9215393e57798776b81a6adf (diff)
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.
-rw-r--r--source/blender/blenkernel/intern/curve.c2
-rw-r--r--source/blender/src/buttons_editing.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index ca237ecab78..d02a7c0ab9e 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -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;
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 24209eb7f62..592a8c1b7aa 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -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",