note navigation crash

David Santamauro <[email protected]>
Newsgroups gmane.comp.audio.ardour.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.