diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-08 08:10:55 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-08 08:10:55 +0300 |
commit | d6059e991afe3e838044da894f605e5a5928ae7f (patch) | |
tree | 51b6cd205b1feeb85ae63e7b3121cc2ae29ceda4 /source/blender/makesrna | |
parent | 5f95a4fb330a787c75442c55e95e8d1da9d2f7a3 (diff) |
Point Density: Prevent crash when scene is not sent to calc_point_density()
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 2b1113746be..cf6097bdc29 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3028,6 +3028,11 @@ void rna_ShaderNodePointDensity_density_calc(bNode *self, NodeShaderTexPointDensity *shader_point_density = self->storage; PointDensity pd; + if (scene == NULL) { + *length = 0; + return; + } + *length = 4 * shader_point_density->resolution * shader_point_density->resolution * shader_point_density->resolution; |