Skip to content

Commit f8e7c4b

Browse files
committed
minimal valid png length is 12 bytes
1 parent 6262bd1 commit f8e7c4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web_src/js/utils/image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export async function pngChunks(blob) {
22
const uint8arr = new Uint8Array(await blob.arrayBuffer());
33
const chunks = [];
4-
if (uint8arr.length < 8) return chunks;
4+
if (uint8arr.length < 12) return chunks;
55
const view = new DataView(uint8arr.buffer);
66
if (view.getBigUint64(0) !== 9894494448401390090n) return chunks;
77

0 commit comments

Comments
 (0)