Fix #25594: Adding mesh while in edit mode with multires - crash.
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 11 Jan 2011 22:06:44 +0000 (22:06 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 11 Jan 2011 22:06:44 +0000 (22:06 +0000)
That primitives, which used ri crash blender, flips normals just after creation
and this normals flipping calls layers interpolation, but MDISPS layer
contains no data still.

Just added checking to layerInterp_mdisps.

source/blender/blenkernel/intern/customdata.c

index 134b0e10280142203fcef9468dc80f8636f5709b..57f66a3734348924976d02c0cbfb6aa14990ca8c 100644 (file)
@@ -445,6 +445,10 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
        float (*sw)[4] = (void*)sub_weights;
        float (*disps)[3], (*out)[3];
 
+       /* happens when flipping normals of newly created mesh */
+       if(!d->totdisp)
+               return;
+
        s = sources[0];
        dst_corners = multires_mdisp_corners(d);
        src_corners = multires_mdisp_corners(s);