Code

fix crash in 2geom (already committed to 2geom)
authorjohanengelen <johanengelen@users.sourceforge.net>
Fri, 30 May 2008 21:13:33 +0000 (21:13 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Fri, 30 May 2008 21:13:33 +0000 (21:13 +0000)
src/2geom/path.cpp

index 564b8c58a39aba68fbfe43feed965d85bf25514c..35c7b76bce80201f6ebd03f2e6e66bf94fc58c40 100644 (file)
@@ -58,8 +58,11 @@ Rect Path::boundsFast() const {
 
 Rect Path::boundsExact() const {
   Rect bounds=front().boundsExact();
-  for ( const_iterator iter=++begin(); iter != end() ; ++iter ) {
-    bounds.unionWith(iter->boundsExact());
+  const_iterator iter = begin();
+  if ( iter != end() ) {
+    for ( ++iter; iter != end() ; ++iter ) {
+      bounds.unionWith(iter->boundsExact());
+    }
   }
   return bounds;
 }