From 1951b7a8a1abef105eef54ed8d0805be259bd102 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Dec 2020 14:38:46 +0400 Subject: [PATCH] Fix possible infinite recursion in video calls. --- Telegram/SourceFiles/calls/calls_call.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp index e78dbd8e9..80712f3b9 100644 --- a/Telegram/SourceFiles/calls/calls_call.cpp +++ b/Telegram/SourceFiles/calls/calls_call.cpp @@ -368,10 +368,10 @@ void Call::setupOutgoingVideo() { _errors.fire({ ErrorType::NoCamera }); _videoOutgoing->setState(Webrtc::VideoState::Inactive); } else if (_state.current() != State::Established - && state != started - && !_videoCapture) { + && (state != Webrtc::VideoState::Inactive) + && (started == Webrtc::VideoState::Inactive)) { _errors.fire({ ErrorType::NotStartedCall }); - _videoOutgoing->setState(started); + _videoOutgoing->setState(Webrtc::VideoState::Inactive); } else if (state != Webrtc::VideoState::Inactive && _instance && !_instance->supportsVideo()) {