Fix crash in replies list management.

This commit is contained in:
John Preston 2020-09-30 21:03:03 +03:00
parent d4f2c96322
commit e8a58c4c8d

View file

@ -551,7 +551,7 @@ bool RepliesList::processMessagesIsEmpty(const MTPmessages_Messages &result) {
*correct = std::max( *correct = std::max(
checkedCount - *decrementFrom - nowSize, checkedCount - *decrementFrom - nowSize,
0); 0);
*decrementFrom = *_fullCount.current() - *correct - nowSize; *decrementFrom = checkedCount - *correct - nowSize;
Assert(*decrementFrom >= 0); Assert(*decrementFrom >= 0);
} else if (_skippedBefore) { } else if (_skippedBefore) {
*_skippedBefore = std::min(*_skippedBefore, checkedCount - nowSize); *_skippedBefore = std::min(*_skippedBefore, checkedCount - nowSize);