@zip.js/zip.js 2.7.30 → 2.7.31

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.
@@ -9224,10 +9224,14 @@
9224
9224
  }
9225
9225
  directoryDataOffset -= directoryDataLength;
9226
9226
  }
9227
+ if (directoryDataOffset >= reader.size) {
9228
+ prependedDataLength = reader.size - directoryDataOffset - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;
9229
+ directoryDataOffset = reader.size - directoryDataLength - END_OF_CENTRAL_DIR_LENGTH;
9230
+ }
9227
9231
  if (expectedLastDiskNumber != lastDiskNumber) {
9228
9232
  throw new Error(ERR_SPLIT_ZIP_FILE);
9229
9233
  }
9230
- if (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {
9234
+ if (directoryDataOffset < 0) {
9231
9235
  throw new Error(ERR_BAD_FORMAT);
9232
9236
  }
9233
9237
  let offset = 0;
@@ -9238,7 +9242,7 @@
9238
9242
  if (getUint32(directoryView, offset) != CENTRAL_FILE_HEADER_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {
9239
9243
  const originalDirectoryDataOffset = directoryDataOffset;
9240
9244
  directoryDataOffset = expectedDirectoryDataOffset;
9241
- prependedDataLength = directoryDataOffset - originalDirectoryDataOffset;
9245
+ prependedDataLength += directoryDataOffset - originalDirectoryDataOffset;
9242
9246
  directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength, diskNumber);
9243
9247
  directoryView = getDataView$1(directoryArray);
9244
9248
  }