From 924c816dbdab3de529603ebc4bb5fda9773aaf17 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 6 Jul 2023 00:00:56 +0200 Subject: [PATCH] fix: Chunk size setting in information view being reset the first time --- lib/external/libwolv | 2 +- .../builtin/source/content/views/view_information.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/external/libwolv b/lib/external/libwolv index 63d2bd325..a31e6efc9 160000 --- a/lib/external/libwolv +++ b/lib/external/libwolv @@ -1 +1 @@ -Subproject commit 63d2bd325837ce112e9e34b146246cda571c58e5 +Subproject commit a31e6efc925ffdf10ea9be758d050c3a603a94d6 diff --git a/plugins/builtin/source/content/views/view_information.cpp b/plugins/builtin/source/content/views/view_information.cpp index 11d17a2e7..259a4a41a 100644 --- a/plugins/builtin/source/content/views/view_information.cpp +++ b/plugins/builtin/source/content/views/view_information.cpp @@ -67,14 +67,14 @@ namespace hex::plugin::builtin { this->m_analyzerTask = TaskManager::createTask("hex.builtin.view.information.analyzing", 0, [this](auto &task) { auto provider = ImHexApi::Provider::get(); - if ((this->m_inputChunkSize <= 0) - || (this->m_analyzedRegion.getStartAddress() >= this->m_analyzedRegion.getEndAddress()) - || (this->m_analyzedRegion.getEndAddress() > provider->getActualSize())) { - // Invalid parameters, set default one - this->m_inputChunkSize = 256; + if ((this->m_analyzedRegion.getStartAddress() >= this->m_analyzedRegion.getEndAddress()) || (this->m_analyzedRegion.getEndAddress() > provider->getActualSize())) { this->m_analyzedRegion = { provider->getBaseAddress(), provider->getActualSize() }; } + if (this->m_inputChunkSize <= 0) { + this->m_inputChunkSize = 256; + } + task.setMaxValue(this->m_analyzedRegion.getSize()); {