]> git.donarmstrong.com Git - lilypond.git/commitdiff
don't read uninited memory from STL map. Fixes disappearing ties problem.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 15 Nov 2006 16:22:03 +0000 (17:22 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 15 Nov 2006 16:22:03 +0000 (17:22 +0100)
lily/tie-formatting-problem.cc

index d22d54bb6a28d43719a13ca5cc1b5111d6af6e88..4dada25d220116b68dfc8f6a70b8a7e962a53a1e 100644 (file)
@@ -514,13 +514,21 @@ Tie_formatting_problem::generate_configuration (int pos, Direction dir,
 Interval
 Tie_formatting_problem::get_head_extent (int col, Direction d, Axis a) const
 {
-  return (*head_extents_.find (Tuple2<int> (col, int (d)))).second[a];
+  Column_extent_map::const_iterator i = head_extents_.find (Tuple2<int> (col, int (d)));
+  if (i != head_extents_.end ())
+    return (*i).second[a];
+  else
+    return Interval ();
 }
 
 Interval
 Tie_formatting_problem::get_stem_extent (int col, Direction d, Axis a) const
 {
-  return (*stem_extents_.find (Tuple2<int> (col, int (d)))).second[a];
+  Column_extent_map::const_iterator i = stem_extents_.find (Tuple2<int> (col, int (d)));
+  if (i != stem_extents_.end ())
+    return (*i).second[a];
+  else
+    return Interval ();
 }
 
 /**