From 65b949d36b385c5fe23399729af86c8b48374d26 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 5 Jun 2019 17:49:12 +0300 Subject: [PATCH] Fix crash in lottie animations. --- Telegram/SourceFiles/lottie/lottie_frame_renderer.cpp | 5 ++++- Telegram/ThirdParty/qtlottie | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/lottie/lottie_frame_renderer.cpp b/Telegram/SourceFiles/lottie/lottie_frame_renderer.cpp index 3cc1a61f9..5929d302e 100644 --- a/Telegram/SourceFiles/lottie/lottie_frame_renderer.cpp +++ b/Telegram/SourceFiles/lottie/lottie_frame_renderer.cpp @@ -173,7 +173,7 @@ void FrameRendererObject::queueGenerateFrames() { SharedState::SharedState(const JsonObject &definition) : _scene(definition) { - if (_scene.endFrame() > _scene.startFrame()) { + if (_scene.isValid()) { auto cover = QImage(); renderFrame(cover, FrameRequest::NonStrict(), 0); init(std::move(cover)); @@ -319,6 +319,9 @@ not_null SharedState::getFrame(int index) const { } Information SharedState::information() const { + if (!_scene.isValid()) { + return {}; + } auto result = Information(); result.frameRate = _scene.frameRate(); result.size = QSize(_scene.width(), _scene.height()); diff --git a/Telegram/ThirdParty/qtlottie b/Telegram/ThirdParty/qtlottie index ddccffed3..6971c1468 160000 --- a/Telegram/ThirdParty/qtlottie +++ b/Telegram/ThirdParty/qtlottie @@ -1 +1 @@ -Subproject commit ddccffed3c87ce6763dd73a6453b1edfb1389743 +Subproject commit 6971c146829b534ec7d9b7cdb6fe4b8f26fe344c