Skip to content

Commit

Permalink
Check lower edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinketer22 committed Jul 22, 2024
1 parent 3cd8ac0 commit 54f3abd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/boc/BitReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ export class BitReader {
}

private _toSafeInteger(src: bigint, alt: string) {
if(BigInt(Number.MAX_SAFE_INTEGER) < src) {
if(BigInt(Number.MAX_SAFE_INTEGER) < src || src < BigInt(Number.MIN_SAFE_INTEGER)) {
throw new TypeError(`${src} is out of safe integer range. Use ${alt} instead`);
}

Expand Down

0 comments on commit 54f3abd

Please sign in to comment.