[Bf-blender-cvs] [42fe1ba] master: Fix T47615: crash trying to use point density with lamp object.

Brecht Van Lommel noreply at git.blender.org
Sun Feb 28 23:04:47 CET 2016


Commit: 42fe1ba84462395b4a0aea4403b5a4d7ff08530f
Author: Brecht Van Lommel
Date:   Sun Feb 28 22:56:18 2016 +0100
Branches: master
https://developer.blender.org/rB42fe1ba84462395b4a0aea4403b5a4d7ff08530f

Fix T47615: crash trying to use point density with lamp object.

===================================================================

M	source/blender/render/intern/source/pointdensity.c

===================================================================

diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 2253265..52c9edb 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);
+		}
 	}
 }




More information about the Bf-blender-cvs mailing list