file-type 17.1.2 → 17.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.js +3 -3
- package/package.json +1 -1
package/core.js
CHANGED
|
@@ -654,7 +654,7 @@ class FileTypeParser {
|
|
|
654
654
|
let ic = 0; // 0 = A, 1 = B, 2 = C, 3
|
|
655
655
|
// = D
|
|
656
656
|
|
|
657
|
-
while ((msb & mask) === 0) {
|
|
657
|
+
while ((msb & mask) === 0 && mask !== 0) {
|
|
658
658
|
++ic;
|
|
659
659
|
mask >>= 1;
|
|
660
660
|
}
|
|
@@ -675,7 +675,7 @@ class FileTypeParser {
|
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
async function readChildren(
|
|
678
|
+
async function readChildren(children) {
|
|
679
679
|
while (children > 0) {
|
|
680
680
|
const element = await readElement();
|
|
681
681
|
if (element.id === 0x42_82) {
|
|
@@ -689,7 +689,7 @@ class FileTypeParser {
|
|
|
689
689
|
}
|
|
690
690
|
|
|
691
691
|
const re = await readElement();
|
|
692
|
-
const docType = await readChildren(
|
|
692
|
+
const docType = await readChildren(re.len);
|
|
693
693
|
|
|
694
694
|
switch (docType) {
|
|
695
695
|
case 'webm':
|