[Ardour-Dev] note navigation crash

David Santamauro david.santamauro at gmail.com
Sun May 26 01:29:31 PDT 2013


Completely reproducable: built from revision 3.1-86-g13f5111

- create midi region
- click anywhere in region except on a note
- click [[ctrl] tab (or any navigation key strokes)

Program received signal SIGSEGV, Segmentation fault.
0x0000000000f74a58 in Gnome::Canvas::CanvasNoteEvent::selected 
(this=0x0) at ../gtk2_ardour/canvas-note-event.h:76
76              bool selected() const { return _selected; }

Basically, _events() is empty

This cures it ...
--------------------------------------------------------


$ git diff gtk2_ardour/midi_region_view.cc
diff --git a/gtk2_ardour/midi_region_view.cc 
b/gtk2_ardour/midi_region_view.cc
index 9925a52..05f4f04 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -3379,7 +3379,7 @@ MidiRegionView::goto_next_note (bool add_to_selection)
  { 
 

         bool use_next = false; 
 

 
 

-       if (_events.back()->selected()) { 
 

+       if (!_events.empty() && _events.back()->selected()) { 
 

                 return; 
 

         } 
 

 
 

@@ -3416,7 +3416,7 @@ MidiRegionView::goto_previous_note (bool 
add_to_selection) 

  { 
 

         bool use_next = false; 
 

 
 

-       if (_events.front()->selected()) { 
 

+       if (!_events.empty() && _events.front()->selected()) { 
 

                 return; 
 

         }




thanks

David


More information about the Ardour-Dev mailing list