diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-03-20 23:16:02 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-03-20 23:16:02 +0000 |
| commit | 1d584c4ddd28280f5c9224175ce39aea9e690600 (patch) | |
| tree | 6d5c7bd1761a3ab01fdef265a201878fcef523ee /src/ui/tool/control-point-selection.cpp | |
| parent | apply 2geom rev. 2169 (bug fix) (diff) | |
| download | inkscape-1d584c4ddd28280f5c9224175ce39aea9e690600.tar.gz inkscape-1d584c4ddd28280f5c9224175ce39aea9e690600.zip | |
control-point-selection : fix a (very unlikely) crash upon dereferencing unitialized bound variable
(bzr r13176)
Diffstat (limited to 'src/ui/tool/control-point-selection.cpp')
| -rw-r--r-- | src/ui/tool/control-point-selection.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index b5ee0a597..d10ed0f0d 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -194,6 +194,8 @@ void ControlPointSelection::align(Geom::Dim2 axis) bound.unionWith(Geom::OptInterval((*i)->position()[d])); } + if (!bound) { return; } + double new_coord = bound->middle(); for (iterator i = _points.begin(); i != _points.end(); ++i) { Geom::Point pos = (*i)->position(); @@ -220,6 +222,8 @@ void ControlPointSelection::distribute(Geom::Dim2 d) bound.unionWith(Geom::OptInterval(pos[d])); } + if (!bound) { return; } + // now we iterate over the multimap and set aligned positions. double step = size() == 1 ? 0 : bound->extent() / (size() - 1); double start = bound->min(); |
