fix: Diff view highlighting issues

This commit is contained in:
WerWolv
2023-01-30 10:26:37 +01:00
parent d6bb408078
commit 6b645192d4
2 changed files with 10 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ namespace hex::plugin::builtin {
}
void FileProvider::readRaw(u64 offset, void *buffer, size_t size) {
if ((offset + size) > this->getActualSize() || buffer == nullptr || size == 0)
if (offset > (this->getActualSize() - size) || buffer == nullptr || size == 0)
return;
std::memcpy(buffer, reinterpret_cast<u8 *>(this->m_mappedFile) + offset, size);