fix issue with negative "all archives" size, fixes #165

This fixes a infrequent problem when (refcount * chunksize) overflowed a int32_t.
chunksize is always <= 8MiB and usually rather ~64KiB (with default chunker params).
Thus, this happened only for high refcounts and/or unusually big chunks.
This commit is contained in:
Thomas Waldmann 2015-08-29 04:46:13 +02:00
parent 1a949eab3e
commit d779057b79
1 changed files with 2 additions and 2 deletions

View File

@ -380,8 +380,8 @@ hashindex_summarize(HashIndex *index, long long *total_size, long long *total_cs
chunks += values[0];
unique_size += values[1];
unique_csize += values[2];
size += values[0] * values[1];
csize += values[0] * values[2];
size += (int64_t) values[0] * values[1];
csize += (int64_t) values[0] * values[2];
}
*total_size = size;
*total_csize = csize;