From 2c167d6d27eedd49e11fc1419582cab0e2caa620 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 22 Oct 2022 15:46:03 +0200 Subject: [PATCH] fix: Crash when scrolling to the end of a file that is multiples of 8 bytes long --- plugins/builtin/source/content/views/view_hex_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/views/view_hex_editor.cpp b/plugins/builtin/source/content/views/view_hex_editor.cpp index 5e520d6cd..db36d6ed4 100644 --- a/plugins/builtin/source/content/views/view_hex_editor.cpp +++ b/plugins/builtin/source/content/views/view_hex_editor.cpp @@ -938,7 +938,7 @@ namespace hex::plugin::builtin { auto [foregroundColor, backgroundColor] = cellColors[x]; - if (isColumnSeparatorColumn(x + 1, columnCount)) { + if (isColumnSeparatorColumn(x + 1, columnCount) && cellColors.size() > x + 1) { auto separatorAddress = x + y * columnCount; auto [nextForegroundColor, nextBackgroundColor] = cellColors[x + 1]; if ((isSelectionValid() && getSelection().overlaps({ separatorAddress, 1 }) && getSelection().getEndAddress() != separatorAddress) || backgroundColor == nextBackgroundColor)