bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue 1336 in lilypond: skipTypesetting segfaults when set during a


From: lilypond
Subject: Re: Issue 1336 in lilypond: skipTypesetting segfaults when set during a skipBars-induced MultiMeasureRest spanner
Date: Wed, 01 Dec 2010 00:50:19 +0000


Comment #9 on issue 1336 by Carl.D.Sorensen: skipTypesetting segfaults when set during a skipBars-induced MultiMeasureRest spanner
http://code.google.com/p/lilypond/issues/detail?id=1336

Here's a patch that seems to avoid the segfault in what I think is a reasonable way. It checks for a null grob to align on and returns an offset of zero if it's found, along with setting a programming error.


diff --git a/lily/self-alignment-interface.cc b/lily/self-alignment-interface.cc
index e339e80..23a89a0 100644
--- a/lily/self-alignment-interface.cc
+++ b/lily/self-alignment-interface.cc
@@ -66,6 +66,11 @@ Self_alignment_interface::aligned_on_self (Grob *me, Axis a, bool
 SCM
 Self_alignment_interface::centered_on_object (Grob *him, Axis a)
 {
+  if (!him)
+    {
+      programming_error ("cannot center: null grob");
+      return scm_from_int (0);
+    }
   return scm_from_double (robust_relative_extent (him, him, a).center ());
 }


It's probably not as "correct" as suiciding the part of the grob that goes away with the earlier programming error, but I think it fixes the critical issue.


Patch is also available on Rietveld:

http://codereview.appspot.com/3308043





reply via email to

[Prev in Thread] Current Thread [Next in Thread]