mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Fix crash in streaming parts loading.
This commit is contained in:
@@ -812,7 +812,7 @@ bool Reader::fillFromSlices(int offset, bytes::span buffer) {
|
||||
// HeaderMode::Good and really are putting the first slice to cache.
|
||||
Assert(result.toCache.number > 0 || _slices.isGoodHeader());
|
||||
|
||||
const auto index = std::min(result.toCache.number, 1) - 1;
|
||||
const auto index = std::max(result.toCache.number, 1) - 1;
|
||||
cancelLoadInRange(index * kInSlice, (index + 1) * kInSlice);
|
||||
putToCache(std::move(result.toCache));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user