diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-02 00:41:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-02 00:41:13 +0400 |
commit | 2942eab57c9677e87d0830fe5e5da35abb869417 (patch) | |
tree | dcdccadb57ceeb1acc575535ed99246b4cd77370 /source/blender | |
parent | 9aafe32147064a41aa653a95c89b50d9585ab3c1 (diff) |
Fix #30413: dynamic paint crash with texture slots with no texture assigned.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 49bacbaf693..1e91738c77d 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -3556,6 +3556,8 @@ Material *RE_init_sample_material(Material *orig_mat, Scene *scene) if(mat->mtex[tex_nr]) { MTex *mtex = mat->mtex[tex_nr]; + if(!mtex->tex) continue; + /* only keep compatible texflags */ mtex->texflag = mtex->texflag & (MTEX_RGBTOINT | MTEX_STENCIL | MTEX_NEGATIVE | MTEX_ALPHAMIX); @@ -3629,9 +3631,12 @@ void RE_free_sample_material(Material *mat) if(mat->septex & (1<<tex_nr)) continue; if(mat->mtex[tex_nr]) { MTex *mtex= mat->mtex[tex_nr]; - free_texture(mtex->tex); - MEM_freeN(mtex->tex); - mtex->tex = NULL; + + if(mtex->tex) { + free_texture(mtex->tex); + MEM_freeN(mtex->tex); + mtex->tex = NULL; + } } } |