From 6b82316853f5767811a4246aa1dfa3b1907c1b2b Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 1 Dec 2013 08:30:43 +0000
Subject: [PATCH] fix crash in reduction

---
 Geo/CellComplex.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Geo/CellComplex.cpp b/Geo/CellComplex.cpp
index 74d32bb50b..9159139db0 100644
--- a/Geo/CellComplex.cpp
+++ b/Geo/CellComplex.cpp
@@ -370,7 +370,7 @@ int CellComplex::reduction(int dim, int omit,
       }
 
       if(getSize(dim) == 0 || getSize(dim-1) == 0) break;
-      cit++;
+      if(cit != lastCell(dim)) cit++;
     }
   }
   _reduced = true;
-- 
GitLab