[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38299] trunk/blender/source/blender/ blenkernel/intern/material.c: Fix #27912: crash after mesh.materials.pop().

Dalai Felinto dfelinto at gmail.com
Tue Jul 26 23:28:02 CEST 2011


Hi Brecht,

Benoit was suggesting (in the texface patch tracker) that this commit may
seem like a bug.
The correct code for this fix should be:
-                                       memmove((*matar), (*matar) + 1,
sizeof(void *) * ((*totcol) - (index + 1)));
+                                       memmove((*matar)+index,
(*matar)+(index+1), sizeof(void *)*((*totcol)-(index+1)));

Any thoughts?
--
Dalai

2011/7/11 Brecht Van Lommel <brechtvanlommel at pandora.be>

> Revision: 38299
>
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38299
> Author:   blendix
> Date:     2011-07-11 09:08:08 +0000 (Mon, 11 Jul 2011)
> Log Message:
> -----------
> Fix #27912: crash after mesh.materials.pop().
>
> Modified Paths:
> --------------
>    trunk/blender/source/blender/blenkernel/intern/material.c
>
> Modified: trunk/blender/source/blender/blenkernel/intern/material.c
> ===================================================================
> --- trunk/blender/source/blender/blenkernel/intern/material.c   2011-07-11
> 09:05:10 UTC (rev 38298)
> +++ trunk/blender/source/blender/blenkernel/intern/material.c   2011-07-11
> 09:08:08 UTC (rev 38299)
> @@ -550,7 +550,7 @@
>                                Material **mat;
>
>                                if(index + 1 != (*totcol))
> -                                       memmove((*matar), (*matar) + 1,
> (*totcol) - (index + 1));
> +                                       memmove((*matar), (*matar) + 1,
> sizeof(void *) * ((*totcol) - (index + 1)));
>
>                                (*totcol)--;
>
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>


More information about the Bf-committers mailing list