@orkestrel/capture 0.0.11 → 0.0.13
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/src/core/index.cjs +1 -1
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.js +1 -1
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +5 -5
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.js +5 -5
- package/dist/src/server/index.js.map +1 -1
- package/package.json +16 -15
package/dist/src/server/index.js
CHANGED
|
@@ -104,7 +104,7 @@ var CAPTURE_OWNER_FILE = ".capture-owner";
|
|
|
104
104
|
* CAPTURE_PID_LIMIT // 2147483647
|
|
105
105
|
* ```
|
|
106
106
|
*/
|
|
107
|
-
var CAPTURE_PID_LIMIT =
|
|
107
|
+
var CAPTURE_PID_LIMIT = 0x7fffffff;
|
|
108
108
|
/**
|
|
109
109
|
* Caps each refusal population so hostile records cannot flood a terminal or agent context.
|
|
110
110
|
* @example
|
|
@@ -1330,7 +1330,7 @@ function predictCaptureByte(left, up, corner) {
|
|
|
1330
1330
|
*/
|
|
1331
1331
|
function readCaptureChunks(bytes, offset = 8) {
|
|
1332
1332
|
requireCaptureImageSize(bytes.length);
|
|
1333
|
-
const positions = scanCaptureChunks(bytes, offset,
|
|
1333
|
+
const positions = scanCaptureChunks(bytes, offset, 1e400);
|
|
1334
1334
|
const types = positions.map((position) => bytes.readUInt32BE(position + 4));
|
|
1335
1335
|
const header = Buffer.from("IHDR", "latin1").readUInt32BE(0);
|
|
1336
1336
|
const palette = Buffer.from("PLTE", "latin1").readUInt32BE(0);
|
|
@@ -1653,7 +1653,7 @@ function encodeCapturePicture(picture, compressed = true) {
|
|
|
1653
1653
|
*/
|
|
1654
1654
|
function sumCaptureRow(pixels, start, columns) {
|
|
1655
1655
|
if (columns > 8) {
|
|
1656
|
-
if (columns ===
|
|
1656
|
+
if (columns === 1e400) throw new CaptureError("Capture sum columns must be a finite sample count, not Infinity", { code: "EVIDENCE" });
|
|
1657
1657
|
const half = Math.ceil(columns / 2);
|
|
1658
1658
|
return sumCaptureRow(pixels, start, half) + sumCaptureRow(pixels, start + half * 3, columns - half);
|
|
1659
1659
|
}
|
|
@@ -1688,7 +1688,7 @@ function sumCaptureRow(pixels, start, columns) {
|
|
|
1688
1688
|
*/
|
|
1689
1689
|
function sumCaptureBlock(picture, top, left, row, rows, columns) {
|
|
1690
1690
|
if (rows > 2) {
|
|
1691
|
-
if (rows ===
|
|
1691
|
+
if (rows === 1e400) throw new CaptureError("Capture sum rows must be a finite row count, not Infinity", { code: "EVIDENCE" });
|
|
1692
1692
|
const half = Math.ceil(rows / 2);
|
|
1693
1693
|
return sumCaptureBlock(picture, top, left, row, half, columns) + sumCaptureBlock(picture, top, left, row + half, rows - half, columns);
|
|
1694
1694
|
}
|
|
@@ -1890,7 +1890,7 @@ function splitCaptureSheets(rows, size, gap) {
|
|
|
1890
1890
|
function readCaptureRequestOwner(name) {
|
|
1891
1891
|
const match = new RegExp(`^${CAPTURE_REQUEST_PREFIX}-(\\d+)\\.json(?:\\.tmp)?$`, "u").exec(name);
|
|
1892
1892
|
const pid = Number(match?.[1]);
|
|
1893
|
-
return isSafeInteger(pid) && pid > 0 && pid <=
|
|
1893
|
+
return isSafeInteger(pid) && pid > 0 && pid <= 0x7fffffff ? pid : void 0;
|
|
1894
1894
|
}
|
|
1895
1895
|
/**
|
|
1896
1896
|
* Describes the request holders that keep a workspace busy, naming apart those the host could not inspect.
|