View Issue Details

IDProjectCategoryView StatusLast Update
0002478ardourbugspublic2020-04-19 20:13
Reportercth103 Assigned Topaul  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Summary0002478: Null pointer deref in MIDI port creation
DescriptionI'm seeing a segfault on starting ardour, but only whilst running inside gdb for some reason. Anyway, the attached patch fixes it.

TagsNo tags attached.

Activities

2008-11-29 01:33

 

midi-crash.txt (1,478 bytes)   
diff --git a/libs/midi++2/jack_midiport.cc b/libs/midi++2/jack_midiport.cc
index 0464649..5ebb55c 100644
--- a/libs/midi++2/jack_midiport.cc
+++ b/libs/midi++2/jack_midiport.cc
@@ -243,7 +243,9 @@ JACK_MidiPort::create_ports(const XMLNode& node)
                _jack_output_port = jack_port_register(_jack_client,
                                                       string(desc.tag).append("_out").c_str(),
                                                       JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0);
-               jack_midi_clear_buffer(jack_port_get_buffer(_jack_output_port, nframes));
+               if (_jack_output_port) {
+                       jack_midi_clear_buffer(jack_port_get_buffer(_jack_output_port, nframes));
+               }
                ret = ret && (_jack_output_port != NULL);
        }
        
@@ -251,7 +253,9 @@ JACK_MidiPort::create_ports(const XMLNode& node)
                _jack_input_port = jack_port_register(_jack_client,
                                                      string(desc.tag).append("_in").c_str(),
                                                      JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0);
-               jack_midi_clear_buffer(jack_port_get_buffer(_jack_input_port, nframes));
+               if (_jack_input_port) {
+                       jack_midi_clear_buffer(jack_port_get_buffer(_jack_input_port, nframes));
+               }
                ret = ret && (_jack_input_port != NULL);
        }

midi-crash.txt (1,478 bytes)   

seablade

2008-12-03 05:59

manager   ~0005456

Went ahead and assigned it to Paul for him to take a look at carl. Thanks.

     Seablade

cth103

2008-12-17 00:44

administrator   ~0005531

Fixed in 3.0.

system

2020-04-19 20:13

developer   ~0021832

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2008-11-29 01:33 cth103 New Issue
2008-11-29 01:33 cth103 File Added: midi-crash.txt
2008-11-29 01:33 cth103 cost => 0.00
2008-12-03 05:58 seablade Status new => assigned
2008-12-03 05:58 seablade Assigned To => paul
2008-12-03 05:59 seablade Note Added: 0005456
2008-12-17 00:44 cth103 Status assigned => resolved
2008-12-17 00:44 cth103 Resolution open => fixed
2008-12-17 00:44 cth103 Note Added: 0005531
2010-04-24 10:28 cth103 Category bugs => bugs2
2010-04-24 10:32 cth103 Category bugs2 => bugs
2020-04-19 20:13 system Note Added: 0021832
2020-04-19 20:13 system Status resolved => closed