diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-01-17 21:04:37 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-01-17 21:04:37 +0000 |
| commit | 38413c0255c7c4e41113c0cacc2a8022d0e0c26b (patch) | |
| tree | 9f10e40c0246fab7a790848f5b41240f1139daa4 | |
| parent | remove SPDesktop from SPNamedView when it is destroyed. Fixing bug 183621, bu... (diff) | |
| download | inkscape-38413c0255c7c4e41113c0cacc2a8022d0e0c26b.tar.gz inkscape-38413c0255c7c4e41113c0cacc2a8022d0e0c26b.zip | |
Geom: fix a crash on assertion in sbasis-to-bezier.cpp
(bzr r4541)
| -rw-r--r-- | src/2geom/exception.h | 1 | ||||
| -rw-r--r-- | src/2geom/sbasis-to-bezier.cpp | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/2geom/exception.h b/src/2geom/exception.h index 0791c8547..920cd5808 100644 --- a/src/2geom/exception.h +++ b/src/2geom/exception.h @@ -53,6 +53,7 @@ public: protected: std::string msgstr; }; +#define throwException(message) throw(Geom::Exception(message, __FILE__, __LINE__)) //----------------------------------------------------------------------- // Two main exception classes: LogicalError and RangeError. diff --git a/src/2geom/sbasis-to-bezier.cpp b/src/2geom/sbasis-to-bezier.cpp index 415b30d89..497091d1c 100644 --- a/src/2geom/sbasis-to-bezier.cpp +++ b/src/2geom/sbasis-to-bezier.cpp @@ -13,6 +13,7 @@ This is wrong, it should read #include "choose.h" #include "svg-path.h" #include <iostream> +#include "exception.h" namespace Geom{ @@ -179,7 +180,9 @@ subpath_from_sbasis_incremental(Geom::OldPathSetBuilder &pb, D2<SBasis> B, doubl #endif void build_from_sbasis(Geom::PathBuilder &pb, D2<SBasis> const &B, double tol) { - assert(B.isFinite()); + if (!B.isFinite()) { + throwException("assertion failed: B.isFinite()"); + } if(tail_error(B, 2) < tol || sbasis_size(B) == 2) { // nearly cubic enough if(sbasis_size(B) <= 1) { pb.lineTo(B.at1()); |
