]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/completion-note-heads-engraver.cc
Merge remote-tracking branch 'origin/translation' into staging
[lilypond.git] / lily / completion-note-heads-engraver.cc
index bddca70abbd3faa3175969eaa769363e067c6ec5..4192b58be1a9f12696aa2faa8b9f284bdf0e5445 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -117,6 +117,12 @@ Completion_heads_engraver::next_moment (Rational const &note_len)
     }
 
   Moment result = *l - *e;
+  if (result < 0)
+    {
+      programming_error ("invalid measure position: "
+                         + e->to_string () + " of " + l->to_string ());
+      return 0;
+    }
   Moment const *unit = unsmob_moment (get_property ("completionUnit"));
 
   if (unit)