diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-05-05 01:56:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-05-05 01:56:01 +0400 |
commit | dec42e07f46dade484f63a3ae0a83a16a88b3bf9 (patch) | |
tree | 49f8196ed81f33d87b5abe734982cbf73f70a56e /source/blender/render | |
parent | 41ed305cb2117860e5a68ecab706d5868ec7c836 (diff) |
fix for raytrace crash on scenes with very large objects, assert could fail with really large numbers, instead return 0.0.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/raytrace/rayobject_rtbuild.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp index 7869a5d8f8c..1c3cdd5919f 100644 --- a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp +++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp @@ -458,8 +458,10 @@ float bb_area(float *min, float *max) sub[2] = max[2]-min[2]; a = (sub[0]*sub[1] + sub[0]*sub[2] + sub[1]*sub[2])*2; - assert(a >= 0.0); - return a; + /* used to have an assert() here on negative results + * however, in this case its likely some overflow or ffast math error. + * so just return 0.0f instead. */ + return a < 0.0f ? 0.0f : a; } int bb_largest_axis(float *min, float *max) |