From 18aa11117ac166dffab23bbf101fb080ff95fb2b Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 2 Dec 2025 20:01:46 +0100 Subject: [PATCH] impr: Fix fixed point inspector row requiring the correct number of bytes to be selected --- plugins/builtin/source/content/data_inspector.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/builtin/source/content/data_inspector.cpp b/plugins/builtin/source/content/data_inspector.cpp index 0147e6e24..a241fb3b7 100644 --- a/plugins/builtin/source/content/data_inspector.cpp +++ b/plugins/builtin/source/content/data_inspector.cpp @@ -313,11 +313,12 @@ namespace hex::plugin::builtin { ContentRegistry::DataInspector::add("hex.builtin.inspector.fixed_point", 1, [totalBits = int(16), fractionBits = int(8)](const std::vector &, std::endian endian, Style style) mutable { std::string value; + auto provider = ImHexApi::Provider::get(); const auto currSelection = ImHexApi::HexEditor::getSelection(); const u32 sizeBytes = (totalBits + 7) / 8; - if (currSelection.has_value() && currSelection->size >= sizeBytes) { + if (currSelection.has_value() && currSelection->getStartAddress() <= provider->getActualSize() - sizeBytes) { u64 fixedPointValue = 0x00; - ImHexApi::Provider::get()->read(currSelection->address, &fixedPointValue, std::min(sizeof(fixedPointValue), currSelection->size)); + provider->read(currSelection->address, &fixedPointValue, std::min(sizeBytes, sizeof(fixedPointValue))); fixedPointValue = changeEndianness(fixedPointValue, sizeBytes, endian); fixedPointValue &= u64(hex::bitmask(totalBits));