Skip to content

Commit 128df31

Browse files
authored
Merge pull request #4015 from softins/check-found-channel-id
2 parents 726cf0d + f5594e7 commit 128df31

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/client.cpp‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,14 @@ void CClient::OnClientIDReceived ( int iServerChanID )
10121012
// allocate and map client-side channel 0
10131013
int iChanID = FindClientChannel ( iServerChanID, true ); // should always return channel 0
10141014

1015+
// make sure we got a real channel (should never occur)
1016+
if ( iChanID == INVALID_INDEX )
1017+
{
1018+
Stop(); // stops audio and channel, sets CS_DISCONNECTED
1019+
emit ConnectingFailed ( tr ( "Unexpected client ID." ) );
1020+
return;
1021+
}
1022+
10151023
// for headless mode we support to mute our own signal in the personal mix
10161024
// (note that the check for headless is done in the main.cpp and must not
10171025
// be checked here)

0 commit comments

Comments
 (0)