From 3be4d5bb45ed8cfb8539a99d391099c9f66ea39d Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 20 Apr 2019 17:51:19 +0100 Subject: [PATCH] Ensure limitInputPixels check uses 64-bit unsigned type --- src/pipeline.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipeline.cc b/src/pipeline.cc index 1d0f5afd..6f61b8a7 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -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(image.width() * image.height()) > static_cast(baton->limitInputPixels)) { (baton->err).append("Input image exceeds pixel limit"); return Error(); }