diff --git a/Telegram/SourceFiles/lottie/lottie_cache.cpp b/Telegram/SourceFiles/lottie/lottie_cache.cpp index 4f742773d..13d272381 100644 --- a/Telegram/SourceFiles/lottie/lottie_cache.cpp +++ b/Telegram/SourceFiles/lottie/lottie_cache.cpp @@ -594,6 +594,9 @@ void Cache::prepareBuffers() { } Cache::ReadResult Cache::readCompressedFrame() { + if (_data.size() < _offset) { + return { false }; + } auto length = qint32(0); const auto part = bytes::make_span(_data).subspan(_offset); if (part.size() < sizeof(length)) {