[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49951] branches/soc-2011-tomato/intern/ cycles/blender/blender_mesh.cpp: Tomato Cycles: fix incorrect memory read when synchronizing mesh motion

Sergey Sharybin sergey.vfx at gmail.com
Fri Aug 17 14:58:31 CEST 2012


Revision: 49951
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49951
Author:   nazgul
Date:     2012-08-17 12:58:31 +0000 (Fri, 17 Aug 2012)
Log Message:
-----------
Tomato Cycles: fix incorrect memory read when synchronizing mesh motion

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/cycles/blender/blender_mesh.cpp

Modified: branches/soc-2011-tomato/intern/cycles/blender/blender_mesh.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/blender/blender_mesh.cpp	2012-08-17 12:53:04 UTC (rev 49950)
+++ branches/soc-2011-tomato/intern/cycles/blender/blender_mesh.cpp	2012-08-17 12:58:31 UTC (rev 49951)
@@ -317,11 +317,11 @@
 		BL::Mesh::vertices_iterator v;
 		AttributeStandard std = (motion == -1)? ATTR_STD_MOTION_PRE: ATTR_STD_MOTION_POST;
 		Attribute *attr_M = mesh->attributes.add(std);
-		float3 *M = attr_M->data_float3();
+		float3 *M = attr_M->data_float3(), *cur_M;
 		size_t i = 0;
 
-		for(b_mesh.vertices.begin(v); v != b_mesh.vertices.end() && i < size; ++v, M++, i++)
-			*M = get_float3(v->co());
+		for(b_mesh.vertices.begin(v), cur_M = M; v != b_mesh.vertices.end() && i < size; ++v, cur_M++, i++)
+			*cur_M = get_float3(v->co());
 
 		/* if number of vertices changed, or if coordinates stayed the same, drop it */
 		if(i != size || memcmp(M, &mesh->verts[0], sizeof(float3)*size) == 0)




More information about the Bf-blender-cvs mailing list