Laplacian Deform Modifier: fix possible NULL pointer dereference.

This commit is contained in:
Campbell Barton 2013-12-03 09:06:22 +11:00
parent a24f83855a
commit 1782376d97
1 changed files with 4 additions and 1 deletions

View File

@ -721,10 +721,13 @@ static void LaplacianDeformModifier_do(
MEM_SAFE_FREE(lmd->vertexco);
lmd->total_verts = 0;
deleteLaplacianSystem(sys);
lmd->cache_system = NULL;
initSystem(lmd, ob, dm, filevertexCos, numVerts);
sys = lmd->cache_system; /* may have been reallocated */
MEM_SAFE_FREE(filevertexCos);
laplacianDeformPreview(sys, vertexCos);
if (sys) {
laplacianDeformPreview(sys, vertexCos);
}
}
else {
if (sysdif == LAPDEFORM_SYSTEM_CHANGE_VERTEXES) {