mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Crash when trying to analyze small files
This commit is contained in:
@@ -154,7 +154,7 @@ namespace hex {
|
||||
void update(u8 byte) {
|
||||
// Check if there is some space left
|
||||
if (this->m_byteCount < this->m_fileSize) {
|
||||
if ((this->m_byteCount % (this->m_fileSize / this->m_sampleSize)) == 0)
|
||||
if ((this->m_byteCount % u64(std::ceil(double(this->m_fileSize) / double(this->m_sampleSize)))) == 0)
|
||||
this->m_buffer.push_back(byte);
|
||||
++this->m_byteCount;
|
||||
if (this->m_byteCount == this->m_fileSize) {
|
||||
@@ -250,7 +250,7 @@ namespace hex {
|
||||
void update(u8 byte) {
|
||||
// Check if there is some space left
|
||||
if (this->m_byteCount < this->m_fileSize) {
|
||||
if ((this->m_byteCount % (this->m_fileSize / this->m_sampleSize)) == 0)
|
||||
if ((this->m_byteCount % u64(std::ceil(double(this->m_fileSize) / double(this->m_sampleSize)))) == 0)
|
||||
this->m_buffer.push_back(byte);
|
||||
++this->m_byteCount;
|
||||
if (this->m_byteCount == this->m_fileSize) {
|
||||
|
||||
Reference in New Issue
Block a user