From eaa4688182e9d2539f5819afa78a786b5207fb04 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 27 Feb 2024 22:39:18 +0100 Subject: [PATCH] fix: Crash when using CRC hashes --- plugins/hashes/source/content/hashes.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/hashes/source/content/hashes.cpp b/plugins/hashes/source/content/hashes.cpp index 8a2ba8e92..e3b0b3131 100644 --- a/plugins/hashes/source/content/hashes.cpp +++ b/plugins/hashes/source/content/hashes.cpp @@ -183,6 +183,9 @@ namespace hex::plugin::hashes { Function create(std::string name) override { return Hash::create(name, [hash = *this](const Region& region, prv::Provider *provider) -> std::vector { auto crc = HashFactory::Checksum::CreateCRC(hash.m_width, hash.m_polynomial, hash.m_initialValue, hash.m_reflectIn, hash.m_reflectOut, hash.m_xorOut, 0, { "CRC" }); + + crc->Initialize(); + auto bytes = hashProviderRegionWithHashLib(region, provider, crc); return bytes;