mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Ensure limitInputPixels check uses 64-bit unsigned type
This commit is contained in:
parent
af7caa7b25
commit
3be4d5bb45
@ -75,7 +75,8 @@ class PipelineWorker : public Nan::AsyncWorker {
|
||||
|
||||
// Limit input images to a given number of pixels, where pixels = width * height
|
||||
// Ignore if 0
|
||||
if (baton->limitInputPixels > 0 && image.width() * image.height() > baton->limitInputPixels) {
|
||||
if (baton->limitInputPixels > 0 &&
|
||||
static_cast<uint64_t>(image.width() * image.height()) > static_cast<uint64_t>(baton->limitInputPixels)) {
|
||||
(baton->err).append("Input image exceeds pixel limit");
|
||||
return Error();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user