From 19f33239e7a76697aa98af5428f0bbd9cfc7b740 Mon Sep 17 00:00:00 2001 From: Christoph Feck Date: Wed, 2 May 2018 02:10:26 +0200 Subject: [PATCH] [XCF/GIMP loader] Raise maximimum allowed image size to 32767x32767 on 64 bit platforms The GIMP image loader had a limit to 16K x 16K pixels, because this would already exhaust the 2 GByte address space limit of 32 bit systems. Remove this limit on 64 bit systems to allow the full 32K x 32K size. BUG: 391970 Differential Revision: https://phabricator.kde.org/D12557 --- src/imageformats/xcf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imageformats/xcf.cpp b/src/imageformats/xcf.cpp index f07a43b..5ca0f0d 100644 --- a/src/imageformats/xcf.cpp +++ b/src/imageformats/xcf.cpp @@ -713,7 +713,8 @@ bool XCFImageFormat::composeTiles(XCFImage &xcf_image) // SANITY CHECK: Catch corrupted XCF image file where the width or height // of a tile is reported are bogus. See Bug# 234030. - if (layer.width > 32767 || layer.height > 32767 || layer.width * layer.height > 16384 * 16384) { + if (layer.width > 32767 || layer.height > 32767 + || (sizeof(void *) == 4 && layer.width * layer.height > 16384 * 16384)) { return false; }