Fix crash in media caching.

This commit is contained in:
John Preston 2019-03-10 12:01:12 +04:00
parent 18c42954ae
commit 2ce4abfdfe
2 changed files with 4 additions and 3 deletions

View File

@ -365,6 +365,7 @@ void Reader::Slices::processCacheResult(
}
// So just process whole result even if we didn't want header really.
slice.flags |= Slice::Flag::LoadingFromCache;
slice.flags &= ~Slice::Flag::LoadedFromCache;
}
if (!(slice.flags & Slice::Flag::LoadingFromCache)) {
// We could've already unloaded this slice using LRU _usedSlices.

View File

@ -77,9 +77,9 @@ private:
struct Slice {
enum class Flag : uchar {
LoadingFromCache = 0x02,
LoadedFromCache = 0x04,
ChangedSinceCache = 0x08,
LoadingFromCache = 0x01,
LoadedFromCache = 0x02,
ChangedSinceCache = 0x04,
};
friend constexpr inline bool is_flag_type(Flag) { return true; }
using Flags = base::flags<Flag>;