From caf1af8963263f3c3a327a8e68b3266cf3cf3d46 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 1 Jun 2019 12:30:38 +0300 Subject: [PATCH] Version 1.7.3: Fix possible stack overflow. --- Telegram/SourceFiles/media/player/media_player_instance.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/media/player/media_player_instance.cpp b/Telegram/SourceFiles/media/player/media_player_instance.cpp index 7a5112a64..6fdafcf51 100644 --- a/Telegram/SourceFiles/media/player/media_player_instance.cpp +++ b/Telegram/SourceFiles/media/player/media_player_instance.cpp @@ -65,6 +65,7 @@ struct Instance::Streamed { Streaming::Player player; Streaming::Information info; View::PlaybackProgress progress; + bool clearing = false; }; Instance::Streamed::Streamed( @@ -164,9 +165,10 @@ void Instance::setCurrent(const AudioMsgId &audioId) { } void Instance::clearStreamed(not_null data) { - if (!data->streamed) { + if (!data->streamed || data->streamed->clearing) { return; } + data->streamed->clearing = true; data->streamed->player.stop(); data->isPlaying = false; requestRoundVideoResize();