We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d41448 commit 640a67dCopy full SHA for 640a67d
1 file changed
lib/types/utils.ts
@@ -79,6 +79,8 @@ export function findBox(input: Uint8Array, boxName: string, offset: number) {
79
const box = readBox(input, offset)
80
if (!box) break
81
if (box.name === boxName) return box
82
- offset += box.size
+ // Fix the infinite loop by ensuring offset always increases
83
+ // If box.size is 0, advance by at least 8 bytes (the size of the box header)
84
+ offset += box.size > 0 ? box.size : 8
85
}
86
0 commit comments