summaryrefslogtreecommitdiff
path: root/view/sharedcache
diff options
context:
space:
mode:
Diffstat (limited to 'view/sharedcache')
-rw-r--r--view/sharedcache/core/DSCView.cpp4
-rw-r--r--view/sharedcache/ui/dsctriage.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/view/sharedcache/core/DSCView.cpp b/view/sharedcache/core/DSCView.cpp
index 3eb40b7e..06a73a69 100644
--- a/view/sharedcache/core/DSCView.cpp
+++ b/view/sharedcache/core/DSCView.cpp
@@ -629,6 +629,8 @@ bool DSCView::Init()
ss.str(data);
rapidjson::Document result(rapidjson::kObjectType);
+ result.Parse(data.c_str());
+
if (result.HasMember("metadataVersion"))
{
if (result["metadataVersion"].GetInt() != METADATA_VERSION)
@@ -643,8 +645,6 @@ bool DSCView::Init()
LogError("Shared cache metadata version not found");
return false;
}
-
- result.Parse(data.c_str());
for (auto& imgV : result["regionsMappedIntoMemory"].GetArray())
{
SharedCacheCore::MemoryRegion region;
diff --git a/view/sharedcache/ui/dsctriage.cpp b/view/sharedcache/ui/dsctriage.cpp
index 8b0decdc..a780bde7 100644
--- a/view/sharedcache/ui/dsctriage.cpp
+++ b/view/sharedcache/ui/dsctriage.cpp
@@ -25,6 +25,8 @@ DSCCacheBlocksView::DSCCacheBlocksView(QWidget* parent, BinaryViewRef data, Ref<
{
setMouseTracking(true);
m_backingCacheCount = SharedCacheAPI::SharedCache::FastGetBackingCacheCount(data);
+ if (m_backingCacheCount == 0)
+ return;
m_blockLuminance.resize(m_backingCacheCount, 128);
m_blockSizeRatios.resize(m_backingCacheCount, 1);
m_currentProgress = m_cache->GetLoadProgress(data);