Fix for [#36374] Read unitialized memory in Freestyle.
[blender-staging.git] / source / blender / freestyle / intern / geometry / BBox.h
index 794ceba48e70a9fc1cd7fc087924827feb5ee3d5..afff36dec7bbaa618a499047a3fd9ebfffad09e6 100644 (file)
@@ -28,6 +28,8 @@
  *  \date 22/05/2003
  */
 
+#include "BLI_utildefines.h"
+
 #ifdef WITH_CXX_GUARDEDALLOC
 #include "MEM_guardedalloc.h"
 #endif
@@ -95,6 +97,7 @@ public:
 
        inline BBox<Point>& operator=(const BBox<Point>& b)
        {
+               BLI_assert(!b.empty());
                _min = b.getMin();
                _max = b.getMax();
                _empty = false;
@@ -103,6 +106,7 @@ public:
 
        inline BBox<Point>& operator+=(const BBox<Point>& b)
        {
+               BLI_assert(!b.empty());
                if (_empty) {
                        _min = b.getMin();
                        _max = b.getMax();