Ensure limitInputPixels uses uint64 (#3349)

This commit is contained in:
Marcos Casagrande
2022-09-06 10:05:51 +02:00
committed by GitHub
parent f7b29d7b59
commit eee0dd36d9
4 changed files with 14 additions and 1 deletions

View File

@@ -507,9 +507,10 @@ namespace sharp {
}
}
}
// Limit input images to a given number of pixels, where pixels = width * height
if (descriptor->limitInputPixels > 0 &&
static_cast<uint64_t>(image.width() * image.height()) > descriptor->limitInputPixels) {
static_cast<uint64_t>(image.width()) * image.height() > descriptor->limitInputPixels) {
throw vips::VError("Input image exceeds pixel limit");
}
return std::make_tuple(image, imageType);