Skip to content

Commit 37ff495

Browse files
committed
if you exceed CHUNK_SIZE safari will crash with a range error
1 parent fb56c49 commit 37ff495

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/utf8.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export function utf8DecodeJs(bytes: Uint8Array, inputOffset: number, byteLength:
138138
units.push(byte1);
139139
}
140140

141-
if (units.length - 4 >= CHUNK_SIZE) {
141+
if (units.length >= CHUNK_SIZE) {
142142
result += String.fromCharCode(...units);
143143
units.length = 0;
144144
}

0 commit comments

Comments
 (0)