aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/hash/mdx_hash/mdx_hash.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hash/mdx_hash/mdx_hash.cpp b/src/hash/mdx_hash/mdx_hash.cpp
index 2d5a2fe82..b630ec227 100644
--- a/src/hash/mdx_hash/mdx_hash.cpp
+++ b/src/hash/mdx_hash/mdx_hash.cpp
@@ -57,7 +57,8 @@ void MDx_HashFunction::add_data(const byte input[], u32bit length)
const u32bit full_blocks = length / HASH_BLOCK_SIZE;
const u32bit remaining = length % HASH_BLOCK_SIZE;
- compress_n(input, full_blocks);
+ if(full_blocks)
+ compress_n(input, full_blocks);
buffer.copy(position, input + full_blocks * HASH_BLOCK_SIZE, remaining);
position += remaining;