Skip to content

Commit

Permalink
fix: encoding of empty fixed-size bitmasks (#7013)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Jul 15, 2024
1 parent b9eca1a commit 91132a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/values/Primitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export function encodeBitMask(
maxValue: number = Math.max(...values),
startValue: number = 1,
): Buffer {
if (values.length === 0) return Buffer.from([0]);
if (!Number.isFinite(maxValue)) return Buffer.from([0]);

const numBytes = Math.ceil((maxValue - startValue + 1) / 8);
const ret = Buffer.alloc(numBytes, 0);
Expand Down

0 comments on commit 91132a2

Please sign in to comment.