fix: Crash when trying to paste invalid data

This commit is contained in:
WerWolv
2023-07-22 18:21:58 +02:00
parent 0faea9d7c7
commit a99f8f78d0

View File

@@ -657,7 +657,11 @@ namespace hex::plugin::builtin {
static void pasteBytes(const Region &selection, bool selectionCheck) {
auto provider = ImHexApi::Provider::get();
auto buffer = parseHexString(ImGui::GetClipboardText());
auto clipboard = ImGui::GetClipboardText();
if (clipboard == nullptr)
return;
auto buffer = parseHexString(clipboard);
if (!selectionCheck) {
if (selection.getStartAddress() + buffer.size() >= provider->getActualSize())