[Bf-blender-cvs] [92f36586e30] master: BLI_math: avoid assert with non-finite numbers

Campbell Barton noreply at git.blender.org
Mon Apr 23 21:09:05 CEST 2018


Commit: 92f36586e30931cf796835fd52d4691dbedfaf9d
Author: Campbell Barton
Date:   Mon Apr 23 21:07:27 2018 +0200
Branches: master
https://developer.blender.org/rB92f36586e30931cf796835fd52d4691dbedfaf9d

BLI_math: avoid assert with non-finite numbers

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

M	source/blender/blenlib/intern/bitmap_draw_2d.c

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

diff --git a/source/blender/blenlib/intern/bitmap_draw_2d.c b/source/blender/blenlib/intern/bitmap_draw_2d.c
index ff62d78796b..f2ec75001b4 100644
--- a/source/blender/blenlib/intern/bitmap_draw_2d.c
+++ b/source/blender/blenlib/intern/bitmap_draw_2d.c
@@ -240,7 +240,7 @@ void BLI_bitmap_draw_2d_tri_v2i(
 		float inv_slope1 = inv_slope(p2, p1);
 		float inv_slope2 = inv_slope(p3, p1);
 		ORDER_VARS2(float, inv_slope1, inv_slope2);
-		BLI_assert(inv_slope1 <= inv_slope2);
+		BLI_assert(!(inv_slope1 > inv_slope2));
 		draw_tri_flat_max(
 		        p1, p2[1],
 		        inv_slope1, inv_slope2,
@@ -251,7 +251,7 @@ void BLI_bitmap_draw_2d_tri_v2i(
 		float inv_slope1 = inv_slope(p3, p1);
 		float inv_slope2 = inv_slope(p3, p2);
 		ORDER_VARS2(float, inv_slope2, inv_slope1);
-		BLI_assert(inv_slope1 >= inv_slope2);
+		BLI_assert(!(inv_slope1 < inv_slope2));
 		draw_tri_flat_min(
 		        p3, p2[1] + 1, /* avoid overlap */
 		        inv_slope1, inv_slope2,



More information about the Bf-blender-cvs mailing list