Skip to content

Commit

Permalink
minimal valid png length is 12 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Feb 11, 2024
1 parent 6262bd1 commit f8e7c4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_src/js/utils/image.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export async function pngChunks(blob) {
const uint8arr = new Uint8Array(await blob.arrayBuffer());
const chunks = [];
if (uint8arr.length < 8) return chunks;
if (uint8arr.length < 12) return chunks;
const view = new DataView(uint8arr.buffer);
if (view.getBigUint64(0) !== 9894494448401390090n) return chunks;

Expand Down

0 comments on commit f8e7c4b

Please sign in to comment.