13
0

Fix FPE when adding audio pins to a MIDI plugins

This commit is contained in:
Robin Gareus 2024-05-04 19:54:20 +02:00
parent 4e44f44e71
commit 8cf0fe5c77
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -1710,6 +1710,17 @@ PluginPinWidget::add_remove_port_clicked (bool add, ARDOUR::DataType dt)
ChanCount ins, outs, src;
_pi->configured_io (ins, outs);
src = _pi->natural_output_streams ();
if (src.get (dt) == 0) {
if (!add || ins.get (dt) < out.get (dt)) {
return;
}
int pn = out.get (dt);
assert (pn > 0);
ChanMapping map (_pi->thru_map ());
map.set (dt, pn - 1, pn - 1);
_pi->set_thru_map (map);
return;
}
for (uint32_t i = n_before; i < outs.get (dt); ++i) {
uint32_t pc = i / src.get (dt);
uint32_t pn = i % src.get (dt);