diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-02-29 00:56:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-02-29 00:57:17 +0300 |
commit | 42fe1ba84462395b4a0aea4403b5a4d7ff08530f (patch) | |
tree | 49beb3d60f8c03d798edebf3f91f78ced4571fdc /source | |
parent | 87c8ff016400f25165555c0a44428c8214409b1e (diff) |
Fix T47615: crash trying to use point density with lamp object.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/intern/source/pointdensity.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 22532651489..52c9edbef6e 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -764,12 +764,18 @@ void RE_point_density_minmax( else { float radius[3] = {pd->radius, pd->radius, pd->radius}; float *loc, *size; - BKE_object_obdata_texspace_get(pd->object, NULL, &loc, &size, NULL); - sub_v3_v3v3(r_min, loc, size); - add_v3_v3v3(r_max, loc, size); - /* Adjust texture space to include density points on the boundaries. */ - sub_v3_v3(r_min, radius); - add_v3_v3(r_max, radius); + + if (BKE_object_obdata_texspace_get(pd->object, NULL, &loc, &size, NULL)) { + sub_v3_v3v3(r_min, loc, size); + add_v3_v3v3(r_max, loc, size); + /* Adjust texture space to include density points on the boundaries. */ + sub_v3_v3(r_min, radius); + add_v3_v3(r_max, radius); + } + else { + zero_v3(r_min); + zero_v3(r_max); + } } } |