From 407341f1be8909ee990f7a7ec0c9f97c0818f243 Mon Sep 17 00:00:00 2001 From: Ishan Goel Date: Tue, 22 Nov 2022 09:53:02 -0800 Subject: [PATCH] fix bug i introduced in previous commit --- aces.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aces.go b/aces.go index 01ce484..f06f5a2 100644 --- a/aces.go +++ b/aces.go @@ -203,7 +203,7 @@ func (bw *bitWriter) write(b byte) error { bw.buf[byteNum] = bw.buf[byteNum] + sliceByteLen(b, bStart, left) // bStart + left is up to where b has been read from. (bw.chunkLen+bitNum) - 8 is how many bits go to the next byte. - bw.buf[byteNum+1] = sliceByteLen(b, bStart+left, bw.chunkLen-left) << (bStart - left) // simplified 8 - (bw.chunkLen + bitNum - 8) + bw.buf[byteNum+1] = sliceByteLen(b, bStart+left, bw.chunkLen-left) << (bStart + left) // simplified 8 - (bw.chunkLen + bitNum - 8) } else { bw.buf[byteNum] = bw.buf[byteNum] + (b << (8 - (bitNum + bw.chunkLen))) }