@threenative/ueformat 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.
package/dist/cli.js CHANGED
@@ -162,7 +162,13 @@ function decompressBody(format, compressed, uncompressedSize, zstdDecoder) {
162
162
  let result;
163
163
  try {
164
164
  if (format === "GZIP") {
165
- result = gunzipSync(compressed);
165
+ result = gunzipSync(compressed, { out: new Uint8Array(uncompressedSize + 1) });
166
+ if (result.length > uncompressedSize) {
167
+ throw new UEFormatError(
168
+ "SIZE_MISMATCH",
169
+ `Decoded body is larger than the ${uncompressedSize} byte(s) its header declares`
170
+ );
171
+ }
166
172
  validateGzipTrailer(compressed, result);
167
173
  } else if (format === "ZSTD") {
168
174
  if (!zstdDecoder) {
package/dist/index.js CHANGED
@@ -161,7 +161,13 @@ function decompressBody(format, compressed, uncompressedSize, zstdDecoder) {
161
161
  let result;
162
162
  try {
163
163
  if (format === "GZIP") {
164
- result = gunzipSync(compressed);
164
+ result = gunzipSync(compressed, { out: new Uint8Array(uncompressedSize + 1) });
165
+ if (result.length > uncompressedSize) {
166
+ throw new UEFormatError(
167
+ "SIZE_MISMATCH",
168
+ `Decoded body is larger than the ${uncompressedSize} byte(s) its header declares`
169
+ );
170
+ }
165
171
  validateGzipTrailer(compressed, result);
166
172
  } else if (format === "ZSTD") {
167
173
  if (!zstdDecoder) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threenative/ueformat",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "MIT",
5
5
  "description": "UEFormat v10 .uemodel parser and Three.js loader for meshes exported from Unreal packages by CUE4Parse/FModel.",
6
6
  "keywords": [
@@ -48,7 +48,8 @@
48
48
  "@types/three": "0.185.3",
49
49
  "publint": "0.3.22",
50
50
  "tsup": "8.5.1",
51
- "typescript": "5.9.3"
51
+ "typescript": "npm:@typescript/typescript6@6.0.2",
52
+ "@typescript/native": "npm:typescript@7.0.2"
52
53
  },
53
54
  "dependencies": {
54
55
  "fflate": "0.8.3",