2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix crash in lottie animations.

This commit is contained in:
John Preston
2019-06-05 17:49:12 +03:00
parent a8d3951116
commit 65b949d36b
2 changed files with 5 additions and 2 deletions

View File

@@ -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<const Frame*> 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());