mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix crash on bad sticker.
DocumentData::getStickerLarge and DocumentData::loaded go to a loop.
This commit is contained in:
parent
26f1ade5ba
commit
45fda44924
1 changed files with 5 additions and 3 deletions
|
@ -845,6 +845,7 @@ bool DocumentData::loaded(FilePathResolveType type) const {
|
||||||
ActiveCache().decrement(that->_data.size());
|
ActiveCache().decrement(that->_data.size());
|
||||||
that->_data = _loader->bytes();
|
that->_data = _loader->bytes();
|
||||||
ActiveCache().increment(that->_data.size());
|
ActiveCache().increment(that->_data.size());
|
||||||
|
|
||||||
if (that->sticker()
|
if (that->sticker()
|
||||||
&& !that->sticker()->image
|
&& !that->sticker()->image
|
||||||
&& !_loader->imageData().isNull()) {
|
&& !_loader->imageData().isNull()) {
|
||||||
|
@ -856,12 +857,13 @@ bool DocumentData::loaded(FilePathResolveType type) const {
|
||||||
_loader->imageData()));
|
_loader->imageData()));
|
||||||
ActiveCache().increment(ComputeUsage(that->sticker()));
|
ActiveCache().increment(ComputeUsage(that->sticker()));
|
||||||
}
|
}
|
||||||
if (!that->_data.isEmpty() || that->getStickerLarge()) {
|
|
||||||
ActiveCache().up(that);
|
|
||||||
}
|
|
||||||
|
|
||||||
that->refreshGoodThumbnail();
|
that->refreshGoodThumbnail();
|
||||||
destroyLoader();
|
destroyLoader();
|
||||||
|
|
||||||
|
if (!that->_data.isEmpty() || that->getStickerLarge()) {
|
||||||
|
ActiveCache().up(that);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_owner->notifyDocumentLayoutChanged(this);
|
_owner->notifyDocumentLayoutChanged(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue