mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
fix: Various invalid iterator and container accesses
This commit is contained in:
@@ -42,7 +42,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
void ViewDataInspector::drawContent() {
|
||||
if (this->m_dataValid) {
|
||||
if (this->m_dataValid && !this->m_updateTask.isRunning()) {
|
||||
this->m_dataValid = false;
|
||||
this->m_cachedData = std::move(this->m_workData);
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
std::array<ImU64, 256> blockValueCounts = { 0 };
|
||||
|
||||
const auto blockCount = provider->getSize() / this->m_blockSize;
|
||||
const auto blockCount = (provider->getSize() / this->m_blockSize) + 1;
|
||||
|
||||
this->m_blockTypeDistributions.fill({});
|
||||
this->m_blockEntropy.clear();
|
||||
|
||||
@@ -22,12 +22,13 @@ namespace hex::plugin::builtin {
|
||||
if (ImGui::IsMouseClicked(0) && ImGui::IsItemActivated() && this->m_dragStartIterator == tools.end())
|
||||
this->m_dragStartIterator = iter;
|
||||
|
||||
if (!ImGui::IsMouseDown(0))
|
||||
this->m_dragStartIterator = tools.end();
|
||||
|
||||
if (!ImGui::IsItemHovered() && this->m_dragStartIterator == iter) {
|
||||
detached = true;
|
||||
}
|
||||
|
||||
if (!ImGui::IsMouseDown(0))
|
||||
this->m_dragStartIterator = tools.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user