error with allocating memory for a new material array (own fault in recent commit)

This commit is contained in:
Campbell Barton
2010-09-03 16:23:31 +00:00
parent 0cf0f5a622
commit 31331fb61d

View File

@@ -472,7 +472,7 @@ void material_append_id(ID *id, Material *ma)
Material ***matar;
if((matar= give_matarar_id(id))) {
short *totcol= give_totcolp_id(id);
Material **mat= MEM_callocN(sizeof(void *) * (*totcol) + 1, "newmatar");
Material **mat= MEM_callocN(sizeof(void *) * ((*totcol) + 1), "newmatar");
if(*totcol) memcpy(mat, *matar, sizeof(void *) * (*totcol));
if(*matar) MEM_freeN(*matar);