Skip to content

Commit db67856

Browse files
committed
Corrected rans normalisation bug introduced in 4ef6c76.
A noddy failure to reinitialise fsum. Odd that it worked when tested before on the original bug - presumably due to luck somehow (wrap around not being detrimental). Fixes samtools/samtools#895.
1 parent 5cb0da4 commit db67856

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cram/rANS_static.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ unsigned char *rans_compress_O0(unsigned char *in, unsigned int in_size,
8989
tr = ((uint64_t)TOTFREQ<<31)/in_size + (1<<30)/in_size;
9090
normalise_harder:
9191
// Normalise so T[i] == TOTFREQ
92-
for (m = M = j = 0; j < 256; j++) {
92+
for (fsum = m = M = j = 0; j < 256; j++) {
9393
if (!F[j])
9494
continue;
9595

0 commit comments

Comments
 (0)