Code

throw exception when sbasis is empty
authorJohan Engelen <goejendaagh@zonnet.nl>
Fri, 25 Jun 2010 21:56:06 +0000 (23:56 +0200)
committerJohan Engelen <goejendaagh@zonnet.nl>
Fri, 25 Jun 2010 21:56:06 +0000 (23:56 +0200)
src/2geom/sbasis-to-bezier.cpp

index ce5bf89bce3999a9e7a2e4e21e0ad8a7bc28bdb3..0a54412543b1c2e2aaac507d2e471fad0d9cf8f6 100644 (file)
@@ -99,6 +99,10 @@ int sgn(unsigned int j, unsigned int k)
 */
 void sbasis_to_bezier (Bezier & bz, SBasis const& sb, size_t sz)
 {
+    if (sb.size() == 0) {
+        THROW_RANGEERROR("size of sb is too small");
+    }
+
     size_t q, n;
     bool even;
     if (sz == 0)