From 368468447f28b0971ac82e48d2ddb1d338f18c14 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 12 May 2022 16:29:12 +0400 Subject: [PATCH] Fix possible crash on bad data. --- Telegram/SourceFiles/data/data_document.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_document.cpp b/Telegram/SourceFiles/data/data_document.cpp index aae2bd788..3fabde796 100644 --- a/Telegram/SourceFiles/data/data_document.cpp +++ b/Telegram/SourceFiles/data/data_document.cpp @@ -1194,7 +1194,9 @@ bool DocumentData::hasRemoteLocation() const { } bool DocumentData::useStreamingLoader() const { - if (const auto info = sticker()) { + if (size <= 0) { + return false; + } else if (const auto info = sticker()) { return info->isWebm(); } return isAnimation()