From 13f025c29a623836bf53347f68a33804b99c7c62 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 24 Dec 2014 08:28:30 -0600 Subject: [PATCH] [libpng17] Restored the old 1-million default limit on rows and columns --- libpng-manual.txt | 12 ++++++------ libpng.3 | 12 ++++++------ pngusr.dfa | 6 +++--- scripts/pnglibconf.dfa | 4 ++-- scripts/pnglibconf.h.prebuilt | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libpng-manual.txt b/libpng-manual.txt index df7124cb8..e768a57ad 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -648,7 +648,7 @@ User limits The PNG specification allows the width and height of an image to be as large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. Since very few applications really need to process such large images, -we have imposed an arbitrary 640000 limit on rows and columns. +we have imposed an arbitrary 1,000,000 limit on rows and columns. Larger images will be rejected immediately with a png_error() call. If you wish to change this limit, you can use @@ -5111,11 +5111,11 @@ and safe limits are used by default (users who need larger limits can still override them at compile time or run time, as described above). The new limits are - default - png_user_width_max 640,000 - png_user_height_max 640,000 - png_user_chunk_cache_max 128 - png_user_chunk_malloc_max 8,000,000 + default spec limit + png_user_width_max 1,000,000 2,147,483,647 + png_user_height_max 1,000,000 2,147,483,647 + png_user_chunk_cache_max 128 unlimited + png_user_chunk_malloc_max 8,000,000 unlimited XIII. Changes to Libpng from version 1.6.x to 1.7.x diff --git a/libpng.3 b/libpng.3 index e45a561e8..bbe19c8f9 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1142,7 +1142,7 @@ callback function: The PNG specification allows the width and height of an image to be as large as 2^(31\-1 (0x7fffffff), or about 2.147 billion rows and columns. Since very few applications really need to process such large images, -we have imposed an arbitrary 640000 limit on rows and columns. +we have imposed an arbitrary 1,000,000 limit on rows and columns. Larger images will be rejected immediately with a png_error() call. If you wish to change this limit, you can use @@ -5605,11 +5605,11 @@ and safe limits are used by default (users who need larger limits can still override them at compile time or run time, as described above). The new limits are - default - png_user_width_max 640,000 - png_user_height_max 640,000 - png_user_chunk_cache_max 128 - png_user_chunk_malloc_max 8,000,000 + default spec limit + png_user_width_max 1,000,000 2,147,483,647 + png_user_height_max 1,000,000 2,147,483,647 + png_user_chunk_cache_max 128 unlimited + png_user_chunk_malloc_max 8,000,000 unlimited .SH XIII. Changes to Libpng from version 1.6.x to 1.7.x diff --git a/pngusr.dfa b/pngusr.dfa index b9c181d45..d68d5d169 100644 --- a/pngusr.dfa +++ b/pngusr.dfa @@ -9,7 +9,7 @@ # appropriate values as #defines preceded by '@' (to cause them # to be passed through to the build of pnglibconf.h), for example: # -# @# define PNG_USER_WIDTH_MAX 1000000 -# @# define PNG_USER_HEIGHT_MAX 1000000 +# @# define PNG_USER_WIDTH_MAX 65535 +# @# define PNG_USER_HEIGHT_MAX 65535 # @# define PNG_USER_CHUNK_CACHE_MAX 256 -# @# define PNG_USER_CHUNK_MALLOC_MAX 4000000 +# @# define PNG_USER_CHUNK_MALLOC_MAX 1000000 diff --git a/scripts/pnglibconf.dfa b/scripts/pnglibconf.dfa index 6d1c5dd40..f874fc9a8 100644 --- a/scripts/pnglibconf.dfa +++ b/scripts/pnglibconf.dfa @@ -393,8 +393,8 @@ option USER_LIMITS requires READ # # Only chunks that are variable in number are counted towards the # USER_CHUNK_CACHE_MAX limit -setting USER_WIDTH_MAX default 640000 /* PNG max is 0x7fffffff */ -setting USER_HEIGHT_MAX default 640000 /* PNG max is 0x7fffffff */ +setting USER_WIDTH_MAX default 1000000 /* Use 0x7fffffff for unlimited */ +setting USER_HEIGHT_MAX default 1000000 /* Use 0x7fffffff for unlimited */ setting USER_CHUNK_CACHE_MAX default 128 /* Use 0 for unlimited */ setting USER_CHUNK_MALLOC_MAX default 8000000 /* Use 0 for unlimited */ diff --git a/scripts/pnglibconf.h.prebuilt b/scripts/pnglibconf.h.prebuilt index d32b6320b..8f073cbaf 100644 --- a/scripts/pnglibconf.h.prebuilt +++ b/scripts/pnglibconf.h.prebuilt @@ -198,8 +198,8 @@ #define PNG_TEXT_Z_DEFAULT_STRATEGY 0 #define PNG_USER_CHUNK_CACHE_MAX 128 /* Use 0 for unlimited */ #define PNG_USER_CHUNK_MALLOC_MAX 8000000 /* Use 0 for unlimited */ -#define PNG_USER_HEIGHT_MAX 640000 /* PNG max is 0x7fffffff */ -#define PNG_USER_WIDTH_MAX 640000 /* PNG max is 0x7fffffff */ +#define PNG_USER_HEIGHT_MAX 1000000 /* Use 0x7fffffff for unlimited */ +#define PNG_USER_WIDTH_MAX 1000000 /* Use 0x7fffffff for unlimited */ #define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 #define PNG_ZLIB_HEADER