13
0

Fix #2478; deref of 0 pointer if jack_port_register fails.

git-svn-id: svn://localhost/ardour2/branches/3.0@4328 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2008-12-17 00:44:08 +00:00
parent d88b950061
commit 058e7f2c01

View File

@ -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);
}