diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-07-17 15:46:05 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-07-17 15:46:05 +0300 |
commit | 5f09348fe8fdbd9397be1e0181014edb71bf657f (patch) | |
tree | b797e4c99587959ad520c858c219f0813b7ae08c /source/blender | |
parent | 82e27f509339a09fd9d6af3ebd7fd05af0b7e1b8 (diff) |
Fix crash texpainting on subsurfed meshes.
Unfortunately, loops and polys are generated, therefore we need to keep
copies. Still not painting after this commit but at least no crash now.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 8f84e96630e..b64aefc4ef7 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -3003,6 +3003,8 @@ static void proj_paint_state_non_cddm_init(ProjPaintState *ps) { if (ps->dm->type != DM_TYPE_CDDM) { ps->dm_mvert = MEM_dupallocN(ps->dm_mvert); + ps->dm_mpoly = MEM_dupallocN(ps->dm_mpoly); + ps->dm_mloop = MEM_dupallocN(ps->dm_mloop); /* looks like these are ok for now.*/ #if 0 ps->dm_mloopuv = MEM_dupallocN(ps->dm_mloopuv); @@ -3890,6 +3892,8 @@ static void project_paint_end(ProjPaintState *ps) /* copy for subsurf/multires, so throw away */ if (ps->dm->type != DM_TYPE_CDDM) { if (ps->dm_mvert) MEM_freeN((void *)ps->dm_mvert); + if (ps->dm_mpoly) MEM_freeN((void *)ps->dm_mpoly); + if (ps->dm_mloop) MEM_freeN((void *)ps->dm_mloop); /* looks like these don't need copying */ #if 0 if (ps->dm_mloopuv) MEM_freeN(ps->dm_mloopuv); |