fix: unpack int checks missing possible types

This commit is contained in:
Derrick Hammer 2023-11-18 06:32:08 -05:00
parent f3c81e0375
commit cac24c9caa
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 12 additions and 1 deletions

View File

@ -166,7 +166,18 @@ export default class Unpacker {
private _unpack(): any {
const b = this._d.getUint8(this._offset);
if (b <= 0x7f || (b >= 0xe0 && b <= 0xff)) {
if (
b <= 0x7f ||
b >= 0xe0 ||
b === 0xcc ||
b === 0xcd ||
b === 0xce ||
b === 0xcf ||
b === 0xd0 ||
b === 0xd1 ||
b === 0xd2 ||
b === 0xd3
) {
return this.unpackInt();
} else if (b === 0xc2 || b === 0xc3 || b === 0xc0) {
return this.unpackBool();