[Bf-blender-cvs] [9e1ca28] master: Fix T38149: crash adding metaball with zero radius.

Brecht Van Lommel noreply at git.blender.org
Fri Jan 10 20:55:05 CET 2014


Commit: 9e1ca2858920f059c957401160d0a9b75b6ff2bf
Author: Brecht Van Lommel
Date:   Fri Jan 10 20:52:18 2014 +0100
https://developer.blender.org/rB9e1ca2858920f059c957401160d0a9b75b6ff2bf

Fix T38149: crash adding metaball with zero radius.

This incorrectly use abs(), that's for integers, not floats.

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

M	source/blender/blenkernel/intern/mball.c

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

diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 603eb50..40a12bd 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -1555,9 +1555,9 @@ static void find_first_points(PROCESS *process, MetaBall *mb, int a)
 					workp_v = in_v;
 					max_len = len_v3v3(out, in);
 
-					nx = abs((out[0] - in[0]) / process->size);
-					ny = abs((out[1] - in[1]) / process->size);
-					nz = abs((out[2] - in[2]) / process->size);
+					nx = fabsf((out[0] - in[0]) / process->size);
+					ny = fabsf((out[1] - in[1]) / process->size);
+					nz = fabsf((out[2] - in[2]) / process->size);
 					
 					max_dim = max_fff(nx, ny, nz);
 					if (max_dim != 0.0f) {




More information about the Bf-blender-cvs mailing list