diff --git a/common/JackNetInterface.cpp b/common/JackNetInterface.cpp index 45b9f507..d8562a05 100644 --- a/common/JackNetInterface.cpp +++ b/common/JackNetInterface.cpp @@ -477,7 +477,7 @@ namespace Jack int rx_bytes = Recv(fParams.fMtu, MSG_PEEK); if ((rx_bytes == 0) || (rx_bytes == SOCKET_ERROR)) { - // O bytes considered an error (lost connection) + // 0 bytes considered an error (lost connection) return SOCKET_ERROR; } diff --git a/common/JackNetTool.h b/common/JackNetTool.h index e78b4ea5..375aa376 100644 --- a/common/JackNetTool.h +++ b/common/JackNetTool.h @@ -637,7 +637,11 @@ namespace Jack for (uint port_index = 0; port_index < port_num; port_index++) { // Use -1 when port is actually connected on other side - fPortBuffer[*active_port_address] = (sample_t*)-1; + if (*active_port_address >= 0 && *active_port_address < fNPorts) { + fPortBuffer[*active_port_address] = (sample_t*)-1; + } else { + jack_error("ActivePortsFromNetwork: incorrect port = %d", *active_port_address); + } active_port_address++; } }