From 0c13bfc90c48bbbb708d07f6a805a328cd93067b Mon Sep 17 00:00:00 2001 From: "PYAPALLI,SAI KISHORE" Date: Thu, 31 Jan 2019 12:00:11 -0500 Subject: [PATCH] Kaitai b32 result is inconsistent for some payload because of overflow #12 --- KaitaiStream.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KaitaiStream.cs b/KaitaiStream.cs index 7bf34c0..16068a1 100644 --- a/KaitaiStream.cs +++ b/KaitaiStream.cs @@ -333,7 +333,7 @@ namespace Kaitai byte[] buf = ReadBytes(bytesNeeded); for (int i = 0; i < buf.Length; i++) { - ulong v = (ulong)(buf[i] << BitsLeft); + ulong v = (ulong)((ulong)buf[i] << BitsLeft); Bits |= v; BitsLeft += 8; }