Allow values for limitInputPixels larger than 32-bit #3238

This commit is contained in:
Lovell Fuller
2022-05-28 08:35:17 +01:00
parent 48e3ea5e29
commit a0568ec0c3
5 changed files with 17 additions and 5 deletions

View File

@@ -86,10 +86,10 @@ function _createInputDescriptor (input, inputOptions, containerOptions) {
inputDescriptor.limitInputPixels = inputOptions.limitInputPixels
? Math.pow(0x3FFF, 2)
: 0;
} else if (is.integer(inputOptions.limitInputPixels) && inputOptions.limitInputPixels >= 0) {
} else if (is.integer(inputOptions.limitInputPixels) && is.inRange(inputOptions.limitInputPixels, 0, Number.MAX_SAFE_INTEGER)) {
inputDescriptor.limitInputPixels = inputOptions.limitInputPixels;
} else {
throw is.invalidParameterError('limitInputPixels', 'integer >= 0', inputOptions.limitInputPixels);
throw is.invalidParameterError('limitInputPixels', 'positive integer', inputOptions.limitInputPixels);
}
}
// unlimited