Bugfix #17902
authorTon Roosendaal <ton@blender.org>
Sun, 2 Nov 2008 14:03:47 +0000 (14:03 +0000)
committerTon Roosendaal <ton@blender.org>
Sun, 2 Nov 2008 14:03:47 +0000 (14:03 +0000)
Black dots appearing in mirroring 3d beveled curves, when using orco
texture coords. Appeared there was memory read just outside of the
allocation.

source/blender/blenkernel/intern/curve.c

index b090ac2b538466081caa7dc58f167af137fbe179..1a671dfe771ec73d5ad2f473317280148ae1a421 100644 (file)
@@ -1100,9 +1100,12 @@ float *make_orco_curve(Object *ob)
                                                fp[1]= 2.0f*v/(dl->nr-1) - 1.0f;
                                                fp[2]= 0.0;
                                        } else {
+                                               float *vert;
                                                int realv= v % dl->nr;
-
-                                               VECCOPY(fp, &dl->verts[(dl->nr*u + realv)*3]);
+                                               int realu= u % dl->parts;
+                                               
+                                               vert= dl->verts + 3*(dl->nr*realu + realv);
+                                               VECCOPY(fp, vert);
 
                                                fp[0]= (fp[0]-cu->loc[0])/cu->size[0];
                                                fp[1]= (fp[1]-cu->loc[1])/cu->size[1];