Comment #1 on issue 1382 by pnorcks: Segfault when setting 'staff-space to 0.0
http://code.google.com/p/lilypond/issues/detail?id=1382

This is a divide-by-zero problem. The patch below stops the segfault, but I'm unsure if this is the solution we want.

diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc
index bec8c80..5a70b16 100644
--- a/lily/staff-symbol-referencer.cc
+++ b/lily/staff-symbol-referencer.cc
@@ -83,7 +83,11 @@ Staff_symbol_referencer::get_position (Grob *me)
       Real y = me->relative_coordinate (c, Y_AXIS)
        - st->relative_coordinate (c, Y_AXIS);

-      p += 2.0 * y / Staff_symbol::staff_space (st);
+      Real staff_space = Staff_symbol::staff_space (st);
+      if (!staff_space)
+       staff_space = 1;
+      p += 2.0 * y / staff_space;
+
       return p;
     }
   else if (!st)



_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to