From 1f8dd95a5ec1d40735319d08c81f279fb7274a62 Mon Sep 17 00:00:00 2001 From: Petr Pucil Date: Wed, 21 Oct 2020 00:02:42 +0200 Subject: [PATCH] Fix readBitsIntLe(): unsigned right bit shift `>>>` Fixes test [BitsSignedB32Le](https://github.com/kaitai-io/kaitai_struct_tests/blob/a7529872b12fdcc197ebc8040c55481722c2ad19/formats/bits_signed_b32_le.ksy) in JS --- KaitaiStream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KaitaiStream.js b/KaitaiStream.js index d1d8672..2433824 100644 --- a/KaitaiStream.js +++ b/KaitaiStream.js @@ -478,7 +478,7 @@ KaitaiStream.prototype.readBitsIntLe = function(n) { // derive reading result var res = this.bits & mask; // remove bottom bits that we've just read by shifting - this.bits >>= n; + this.bits >>>= n; this.bitsLeft -= n; return res;