fix: Multi-byte hex editor data visualizers behaving incorrectly

This commit is contained in:
WerWolv
2023-11-13 09:28:57 +01:00
parent 27f420c8ea
commit 1f73a87327
2 changed files with 6 additions and 3 deletions

View File

@@ -162,8 +162,11 @@ namespace hex::plugin::builtin::ui {
if (this->m_shouldUpdateEditingValue && address == this->m_editingAddress) {
this->m_shouldUpdateEditingValue = false;
this->m_editingBytes.resize(size);
std::memcpy(this->m_editingBytes.data(), data, size);
if (this->m_editingBytes.size() < size) {
this->m_editingBytes.resize(size);
std::memcpy(this->m_editingBytes.data(), data, size);
}
}
if (this->m_editingAddress != address || this->m_editingCellType != cellType) {