Ensure correct pageHeight when verifying image dimensions (#2343)

This commit is contained in:
Denis Soldatov
2020-08-28 15:39:19 +03:00
committed by GitHub
parent 866e9824d1
commit 00e65f6f14
4 changed files with 11 additions and 2 deletions

View File

@@ -485,8 +485,8 @@ namespace sharp {
Check the proposed format supports the current dimensions.
*/
void AssertImageTypeDimensions(VImage image, ImageType const imageType) {
const int height = image.get_typeof("pageHeight") == G_TYPE_INT
? image.get_int("pageHeight")
const int height = image.get_typeof(VIPS_META_PAGE_HEIGHT) == G_TYPE_INT
? image.get_int(VIPS_META_PAGE_HEIGHT)
: image.height();
if (imageType == ImageType::JPEG) {
if (image.width() > 65535 || height > 65535) {