diff --git a/lib/external/pattern_language b/lib/external/pattern_language index 31ae5773b..55324f345 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit 31ae5773b099cb48cdd81bc8b6c01e6da94fe672 +Subproject commit 55324f345e955bdc8ba23b32feeae31acbbc3ffc diff --git a/plugins/builtin/source/content/views/view_hex_editor.cpp b/plugins/builtin/source/content/views/view_hex_editor.cpp index b701d063b..5053659b1 100644 --- a/plugins/builtin/source/content/views/view_hex_editor.cpp +++ b/plugins/builtin/source/content/views/view_hex_editor.cpp @@ -655,24 +655,26 @@ namespace hex::plugin::builtin { const auto cellBytes = std::min(validBytes, bytesPerCell); // Query cell colors - const auto foregroundColor = queryForegroundColor(byteAddress, &bytes[x], cellBytes); - const auto backgroundColor = [&]{ - auto color = queryBackgroundColor(byteAddress, &bytes[x], cellBytes); + if (x < validBytes) { + const auto foregroundColor = queryForegroundColor(byteAddress, &bytes[x], cellBytes); + const auto backgroundColor = [&]{ + auto color = queryBackgroundColor(byteAddress, &bytes[x], cellBytes); - if ((byteAddress >= selectionMin && byteAddress <= selectionMax)) { - if (color.has_value()) - color = ((ImAlphaBlendColors(color.value(), this->m_selectionColor)) & 0x00FFFFFF) | (this->m_selectionColor & 0xFF000000); - else - color = this->m_selectionColor; - } + if ((byteAddress >= selectionMin && byteAddress <= selectionMax)) { + if (color.has_value()) + color = ((ImAlphaBlendColors(color.value(), this->m_selectionColor)) & 0x00FFFFFF) | (this->m_selectionColor & 0xFF000000); + else + color = this->m_selectionColor; + } - return color; - }(); + return color; + }(); - cellColors.emplace_back( - foregroundColor, - backgroundColor - ); + cellColors.emplace_back( + foregroundColor, + backgroundColor + ); + } } }