From 5f023102a80217968af382020f9b3b654ad60e7f Mon Sep 17 00:00:00 2001 From: hondaxiao Date: Wed, 18 Jan 2023 14:02:27 +0800 Subject: [PATCH] [core] Fix negative id when wrap around --- srtcore/api.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/srtcore/api.cpp b/srtcore/api.cpp index f55c1e5d0..40c4e4762 100644 --- a/srtcore/api.cpp +++ b/srtcore/api.cpp @@ -326,6 +326,7 @@ SRTSOCKET srt::CUDTUnited::generateSocketID(bool for_group) // We have a rollover on the socket value, so // definitely we haven't made the Columbus mistake yet. m_SocketIDGenerator = MAX_SOCKET_VAL; + sockval = MAX_SOCKET_VAL; } // Check all sockets if any of them has this value.