2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Attempt to fix crash in story preloading.

This commit is contained in:
John Preston
2023-07-25 20:50:21 +04:00
parent 35f0f87f73
commit 30334b6c74
5 changed files with 9 additions and 4 deletions

View File

@@ -54,6 +54,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace {
constexpr auto kDefaultCoverThumbnailSize = 100;
constexpr auto kMaxAllowedPreloadPrefix = 6 * 1024 * 1024;
const auto kLottieStickerDimensions = QSize(
kStickerSideSize,
@@ -393,7 +394,7 @@ void DocumentData::setattributes(
if (data.is_round_message()) {
_additional = std::make_unique<RoundData>();
} else if (const auto size = data.vpreload_prefix_size()) {
if (size->v > 0) {
if (size->v > 0 && size->v < kMaxAllowedPreloadPrefix) {
_videoPreloadPrefix = size->v;
}
}