From 9616befcd379cc7173356998ff4c7b055b21e361 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 13 Aug 2015 17:48:12 +0200 Subject: 2Geom: update to r2422. Fixes LP #1482806: crash on Pattern along Path with horizontal segments. This was caused by empty SBasis objects. After the changes in 2Geom, empty SBasis objects should no longer be created. Fixed bugs: - https://launchpad.net/bugs/1482806 (bzr r14299) --- src/2geom/sbasis-roots.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/2geom/sbasis-roots.cpp') diff --git a/src/2geom/sbasis-roots.cpp b/src/2geom/sbasis-roots.cpp index 57bef4c0f..e3e5e4441 100644 --- a/src/2geom/sbasis-roots.cpp +++ b/src/2geom/sbasis-roots.cpp @@ -222,7 +222,7 @@ static void multi_roots_internal(SBasis const &f, double b, double fb){ - if (f.size()==0){ + if (f.isZero(0)){ int idx; idx=upper_level(levels,0,vtol); if (idx<(int)levels.size()&&fabs(levels.at(idx))<=vtol){ @@ -414,7 +414,7 @@ static void level_sets_internal(SBasis const &f, double fb, double tol=1e-5){ - if (f.size()==0){ + if (f.isZero(0)){ unsigned idx; idx=upper_level( levels, 0. ); if (idx roots1(SBasis const & s, Interval const ivl) { std::vector roots(SBasis const & s) { switch(s.size()) { case 0: + assert(false); return std::vector(); case 1: return roots1(s); @@ -628,6 +629,7 @@ std::vector roots(SBasis const & s) { std::vector roots(SBasis const & s, Interval const ivl) { switch(s.size()) { case 0: + assert(false); return std::vector(); case 1: return roots1(s, ivl); -- cgit v1.2.3