Skip to content

Commit ae57352

Browse files
committed
Fix some subtle flaws in the last 2 bytes of multiblock bit reads.
1 parent 2d8bc4d commit ae57352

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sc2reader/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,8 @@ def read(self, bytes=0, bits=0):
392392
first = first >> abs(adjustment)
393393
raw_bytes.append(first | last)
394394
elif adjustment > 0:
395-
raw_bytes.append(last & adjustment_mask)
396-
raw_bytes.append(first | (last >> adjustment))
395+
raw_bytes.append(first | (last & lo_mask))
396+
raw_bytes.append(last >> old_bit_shift)
397397
else:
398398
raw_bytes.append(first | last)
399399

0 commit comments

Comments
 (0)