From 6b04368b6f334ec6f8e9791c9b25f56014ef5abf Mon Sep 17 00:00:00 2001 From: Tony Mountifield Date: Sun, 29 Nov 2026 17:10:29 +0000 Subject: [PATCH 1/3] Ensure FindClientChannel() has returned a real channel --- src/client.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client.cpp b/src/client.cpp index 2505333d7d..a2e406e789 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1012,6 +1012,12 @@ void CClient::OnClientIDReceived ( int iServerChanID ) // allocate and map client-side channel 0 int iChanID = FindClientChannel ( iServerChanID, true ); // should always return channel 0 + // make sure we got a real channel (should never occur) + if ( iChanID == INVALID_INDEX ) + { + return; + } + // for headless mode we support to mute our own signal in the personal mix // (note that the check for headless is done in the main.cpp and must not // be checked here) From 8760a9a359835d19d8997d5a5380bba5a354e17d Mon Sep 17 00:00:00 2001 From: Tony Mountifield Date: Sun, 29 Nov 2026 17:43:47 +0000 Subject: [PATCH 2/3] Do not stay in Connecting state on error --- src/client.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client.cpp b/src/client.cpp index a2e406e789..4ab78b63b9 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1015,6 +1015,8 @@ void CClient::OnClientIDReceived ( int iServerChanID ) // make sure we got a real channel (should never occur) if ( iChanID == INVALID_INDEX ) { + SetConnectionState ( CS_DISCONNECTED ); + emit ConnectingFailed ( tr ( "Unexpected client ID." ) ); return; } From f5594e7f07bcf00e631b610e319adafdcdded32f Mon Sep 17 00:00:00 2001 From: Tony Mountifield Date: Sun, 29 Nov 2026 17:48:53 +0000 Subject: [PATCH 3/3] Update src/client.cpp Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.cpp b/src/client.cpp index 4ab78b63b9..00b1c7d99a 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1015,7 +1015,7 @@ void CClient::OnClientIDReceived ( int iServerChanID ) // make sure we got a real channel (should never occur) if ( iChanID == INVALID_INDEX ) { - SetConnectionState ( CS_DISCONNECTED ); + Stop(); // stops audio and channel, sets CS_DISCONNECTED emit ConnectingFailed ( tr ( "Unexpected client ID." ) ); return; }