@threenative/raw-unreal 0.1.4 → 0.1.6

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -1
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -191,8 +191,13 @@ function readPackageSummary(bytes) {
191
191
  const legacyFileVersion = view.getInt32(4, true);
192
192
  const legacyUE3Version = view.getInt32(8, true);
193
193
  const fileVersionUE4 = view.getInt32(12, true);
194
- const fileVersionUE5 = legacyFileVersion <= -8 ? view.getInt32(16, true) : void 0;
195
194
  const licenseeOffset = legacyFileVersion <= -8 ? 20 : 16;
195
+ if (bytes.byteLength < licenseeOffset + 4) {
196
+ throw new UAssetError("TRUNCATED_PACKAGE", "Unreal package summary is truncated", {
197
+ byteLength: bytes.byteLength
198
+ });
199
+ }
200
+ const fileVersionUE5 = legacyFileVersion <= -8 ? view.getInt32(16, true) : void 0;
196
201
  const licenseeVersion = view.getInt32(licenseeOffset, true);
197
202
  const afterLicensee = licenseeOffset + 4;
198
203
  const editorObjectVersion = findEditorObjectVersion(bytes, afterLicensee);
@@ -295,6 +300,7 @@ function walkSummary(bytes, summary) {
295
300
  }
296
301
  if (legacyFileVersion > -7) reader.skip(4, "NumTextureAllocations");
297
302
  reader.skip(4, "AssetRegistryDataOffset");
303
+ reader.ensure(8, "BulkDataStartOffset");
298
304
  const bulkDataStartOffset = Number(
299
305
  new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getBigInt64(reader.pos, true)
300
306
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threenative/raw-unreal",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "MIT",
5
5
  "description": "Loads raw Unreal editor .uasset static meshes directly into Three.js geometry — UE5 FMeshDescription and UE4.18 FRawMesh layouts, with no interchange conversion.",
6
6
  "keywords": [
@@ -46,7 +46,8 @@
46
46
  "ooz-wasm": "2.0.0",
47
47
  "publint": "0.3.22",
48
48
  "tsup": "8.5.1",
49
- "typescript": "5.9.3"
49
+ "typescript": "npm:@typescript/typescript6@6.0.2",
50
+ "@typescript/native": "npm:typescript@7.0.2"
50
51
  },
51
52
  "dependencies": {
52
53
  "three": "0.185.1"