mediabunny 1.9.1 → 1.9.2

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.
@@ -1766,6 +1766,7 @@ var Mediabunny = (() => {
1766
1766
  async addEncodedAudioPacket(track, packet, meta) {
1767
1767
  const release = await this.mutex.acquire();
1768
1768
  try {
1769
+ this.validateAndNormalizeTimestamp(track, packet.timestamp, packet.type === "key");
1769
1770
  if (!this.audioSpecificConfig) {
1770
1771
  validateAudioChunkMetadata(meta);
1771
1772
  const description = meta?.decoderConfig?.description;
@@ -12473,11 +12474,15 @@ ${cue.notes ?? ""}`;
12473
12474
  this.metadataReader.pos = sourceSize - 4;
12474
12475
  const lastWord = this.metadataReader.readU32();
12475
12476
  const potentialMfraPos = sourceSize - lastWord;
12476
- if (potentialMfraPos >= 0 && potentialMfraPos < sourceSize) {
12477
- await this.metadataReader.reader.loadRange(potentialMfraPos, sourceSize);
12477
+ if (potentialMfraPos >= 0 && potentialMfraPos <= sourceSize - MAX_BOX_HEADER_SIZE) {
12478
+ await this.metadataReader.reader.loadRange(potentialMfraPos, potentialMfraPos + 2 ** 16);
12478
12479
  this.metadataReader.pos = potentialMfraPos;
12479
12480
  const boxInfo = this.metadataReader.readBoxHeader();
12480
12481
  if (boxInfo.name === "mfra") {
12482
+ await this.metadataReader.reader.loadRange(
12483
+ potentialMfraPos,
12484
+ potentialMfraPos + boxInfo.totalSize
12485
+ );
12481
12486
  this.readContiguousBoxes(boxInfo.contentSize);
12482
12487
  }
12483
12488
  }