diff --git a/lib/external/libwolv b/lib/external/libwolv index 101da1689..a34c24130 160000 --- a/lib/external/libwolv +++ b/lib/external/libwolv @@ -1 +1 @@ -Subproject commit 101da1689211a40c576b9d39d5cd38fa4c3d8c52 +Subproject commit a34c241303d846b3a080920d7c6b1579522c163d diff --git a/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp b/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp index 302de59f1..d1ec72730 100644 --- a/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp +++ b/plugins/builtin/source/content/popups/hex_editor/popup_hex_editor_find.cpp @@ -211,11 +211,21 @@ namespace hex::plugin::builtin { } std::optional PopupFind::findByteSequence(const std::vector &sequence) const { + if (sequence.empty()) + return std::nullopt; + auto provider = ImHexApi::Provider::get(); + if (provider == nullptr) + return std::nullopt; + + const auto providerSize = provider->getActualSize(); + if (providerSize == 0x00) + return std::nullopt; + prv::ProviderReader reader(provider); auto startAbsolutePosition = provider->getBaseAddress(); - auto endAbsolutePosition = provider->getBaseAddress() + provider->getActualSize() - 1; + auto endAbsolutePosition = provider->getBaseAddress() + providerSize - 1; constexpr static auto searchFunction = [](const auto &haystackBegin, const auto &haystackEnd, const auto &needleBegin, const auto &needleEnd) {