Merge pull request #13 from spyapalli/master

Kaitai b32 result is inconsistent for some payload because of overflo…
This commit is contained in:
Mikhail Yakshin 2019-01-31 17:05:33 +00:00 committed by GitHub
commit 3b94aa4643
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}