refix for #27912: crash after mesh.materials.pop() (fixed wrongly on rev. 38299 ...
authorDalai Felinto <dfelinto@gmail.com>
Wed, 27 Jul 2011 20:36:11 +0000 (20:36 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 27 Jul 2011 20:36:11 +0000 (20:36 +0000)
bug spotted while reviewing a patch.
things are working now

source/blender/blenkernel/intern/material.c

index 962c7fd..3f01c55 100644 (file)
@@ -550,7 +550,7 @@ Material *material_pop_id(ID *id, int index)
                                Material **mat;
 
                                if(index + 1 != (*totcol))
-                                       memmove((*matar), (*matar) + 1, sizeof(void *) * ((*totcol) - (index + 1)));
+                                       memmove((*matar)+index, (*matar)+(index+1), sizeof(void *) * ((*totcol) - (index + 1)));
 
                                (*totcol)--;