Merging r58362 through r58463 from trunk into soc-2013-depsgraph_mt
[blender.git] / source / blender / blenkernel / intern / mesh.c
index 95e45bce623c5df816f98d62e8d4b1df1fcdf0f4..49827a5df22c74b16216c862e76a7915d2874541 100644 (file)
@@ -2203,10 +2203,13 @@ static void bm_corners_to_loops_ex(ID *id, CustomData *fdata, CustomData *ldata,
                                if (ld->disps)
                                        MEM_freeN(ld->disps);
 
-                               ld->disps = MEM_callocN(sizeof(float) * 3 * side * side, "converted loop mdisps");
+                               ld->disps = MEM_mallocN(sizeof(float) * 3 * side * side, "converted loop mdisps");
                                if (fd->disps) {
                                        memcpy(ld->disps, disps, sizeof(float) * 3 * side * side);
                                }
+                               else {
+                                       memset(ld->disps, 0, sizeof(float) * 3 * side * side);
+                               }
                        }
                }
        }