From 3cebd6d923b8fdfb538c156cb0c7e1ef91d009a1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 27 Jan 2025 18:10:38 +0400 Subject: [PATCH] Fix deadlock in audio for notification repacking. --- Telegram/SourceFiles/ffmpeg/ffmpeg_bytes_io_wrap.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ffmpeg/ffmpeg_bytes_io_wrap.h b/Telegram/SourceFiles/ffmpeg/ffmpeg_bytes_io_wrap.h index 3899325f0..b7387ba97 100644 --- a/Telegram/SourceFiles/ffmpeg/ffmpeg_bytes_io_wrap.h +++ b/Telegram/SourceFiles/ffmpeg/ffmpeg_bytes_io_wrap.h @@ -21,7 +21,9 @@ struct ReadBytesWrap { const auto toRead = std::min( int64(buf_size), wrap->size - wrap->offset); - if (toRead > 0) { + if (!toRead) { + return AVERROR_EOF; + } else if (toRead > 0) { memcpy(buf, wrap->data + wrap->offset, toRead); wrap->offset += toRead; }