From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Date: Wed, 6 Aug 2008 11:48:52 +0000 (-0300)
Subject: Fix potential NULL dereference in Staff_symbol::on_line().
X-Git-Tag: release/2.11.55-2
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0d1bbea7ce87d79261e143171942b76aa9a8dad2;p=lilypond.git

Fix potential NULL dereference in Staff_symbol::on_line().
---

diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc
index 6e376434ca..6fefc48010 100644
--- a/lily/staff-symbol.cc
+++ b/lily/staff-symbol.cc
@@ -170,8 +170,7 @@ Staff_symbol::height  (SCM smob)
 bool
 Staff_symbol::on_line (Grob *me, int pos)
 {
-  Grob *st = Staff_symbol_referencer::get_staff_symbol (me);
-  SCM line_positions = st->get_property ("line-positions");
+  SCM line_positions = me->get_property ("line-positions");
   if (scm_is_pair (line_positions))
     {
       Real min_line = HUGE_VAL;
@@ -195,7 +194,7 @@ Staff_symbol::on_line (Grob *me, int pos)
       return false;
     }
   else
-    return ((abs (pos + line_count (st)) % 2) == 1);
+    return ((abs (pos + line_count (me)) % 2) == 1);
 }
 
 ADD_INTERFACE (Staff_symbol,