Don't merge buffers if greater than fs write maximum of 2147479552

This commit is contained in:
Sean Lilley 2022-12-15 17:24:48 -05:00
parent 9b018ff696
commit fe86e03cda

View File

@ -1,5 +1,7 @@
"use strict"; "use strict";
const BUFFER_MAX_BYTE_LENGTH = require("buffer").constants.MAX_LENGTH; const FS_WRITE_MAX_LENGTH = 2147479552; // See https://github.com/nodejs/node/issues/35605
const BUFFER_MAX_LENGTH = require("buffer").constants.MAX_LENGTH;
const BUFFER_MAX_BYTE_LENGTH = Math.min(FS_WRITE_MAX_LENGTH, BUFFER_MAX_LENGTH);
const Cesium = require("cesium"); const Cesium = require("cesium");
const getBufferPadded = require("./getBufferPadded"); const getBufferPadded = require("./getBufferPadded");
const getDefaultMaterial = require("./loadMtl").getDefaultMaterial; const getDefaultMaterial = require("./loadMtl").getDefaultMaterial;