diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-17 16:10:28 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-17 16:12:06 +0300 |
commit | 729bd7ddd98d7bad98bb8479f4e03ed1536b20c8 (patch) | |
tree | 9bd9a36352e5e4c1f10e6fbe050dede94f8c3982 /source | |
parent | 7f5c6834f8242e9d573420f65b4dd127e53002cf (diff) |
Fix T65693: Crash removing higher on special multires objects
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 7fefabd1c12..17d6b623b33 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -634,20 +634,20 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl) disps = MEM_calloc_arrayN(totdisp, 3 * sizeof(float), "multires disps"); - ndisps = disps; - hdisps = mdisp->disps; - - multires_copy_grid(ndisps, hdisps, nsize, hsize); - if (mdisp->hidden) { - BLI_bitmap *gh = multires_mdisps_downsample_hidden(mdisp->hidden, mdisp->level, lvl); - MEM_freeN(mdisp->hidden); - mdisp->hidden = gh; - } + if (mdisp->disps != NULL) { + ndisps = disps; + hdisps = mdisp->disps; + + multires_copy_grid(ndisps, hdisps, nsize, hsize); + if (mdisp->hidden) { + BLI_bitmap *gh = multires_mdisps_downsample_hidden(mdisp->hidden, mdisp->level, lvl); + MEM_freeN(mdisp->hidden); + mdisp->hidden = gh; + } - ndisps += nsize * nsize; - hdisps += hsize * hsize; + MEM_freeN(mdisp->disps); + } - MEM_freeN(mdisp->disps); mdisp->disps = disps; mdisp->totdisp = totdisp; mdisp->level = lvl; |