Skip to content

Can't read long bit length #5

Description

@nickboucher

Just as in Issue #4, JS 32-bit limitations for bitwise operations prevent reading bit lengths greater than 31 bits because of the following section of .readbits():

    while (size < n) {
      byte = this._nextbyte();
      if (byte == null) {
        break;
      }
      size += 8;
      // This is the problematic line, since the bitshift value accumulates within the `while` loop
      bits = bits << 8 | byte;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions