mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Display user limits in the output from pngtest.
This commit is contained in:
parent
1d3a1e36a7
commit
92ef42d5e1
10
ANNOUNCE
10
ANNOUNCE
@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.7.0beta51 - February 15, 2015
|
||||
Libpng 1.7.0beta51 - February 17, 2015
|
||||
|
||||
This is not intended to be a public release. It will be replaced
|
||||
within a few weeks by a public version or by another test version.
|
||||
@ -714,7 +714,13 @@ Version 1.7.0beta50 [February 15, 2015]
|
||||
being tested, a second tst_row buffer. This improves CPU speed
|
||||
over that achieved by libpng-1.7.0beta49.
|
||||
|
||||
Version 1.7.0beta51 [February 15, 2015]
|
||||
Version 1.7.0beta51 [February 17, 2015]
|
||||
Combined similar parts of png_write_find_filter() into a png_increase_lmins()
|
||||
function.
|
||||
Display user limits in the output from pngtest.
|
||||
Replaced test for harmless integer overflow (wraparound) in pngwutil.c
|
||||
with a method that prevents overflow and does not increase cpu usage
|
||||
significantly.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
||||
8
CHANGES
8
CHANGES
@ -5003,7 +5003,13 @@ Version 1.7.0beta50 [February 15, 2015]
|
||||
being tested, a second tst_row buffer. This improves CPU speed
|
||||
over that achieved by libpng-1.7.0beta49.
|
||||
|
||||
Version 1.7.0beta51 [February 15, 2015]
|
||||
Version 1.7.0beta51 [February 17, 2015]
|
||||
Combined similar parts of png_write_find_filter() into a png_increase_lmins()
|
||||
function.
|
||||
Display user limits in the output from pngtest.
|
||||
Replaced test for harmless integer overflow (wraparound) in pngwutil.c
|
||||
with a method that prevents overflow and does not increase cpu usage
|
||||
significantly.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
||||
24
pngtest.c
24
pngtest.c
@ -1,8 +1,8 @@
|
||||
|
||||
/* pngtest.c - a simple test program to test libpng
|
||||
*
|
||||
* Last changed in libpng 1.6.15 [November 20, 2014]
|
||||
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.6.17 [(PENDING RELEASE)]
|
||||
* Copyright (c) 1998-2015 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
@ -1701,6 +1701,8 @@ main(int argc, char *argv[])
|
||||
int multiple = 0;
|
||||
int ierror = 0;
|
||||
|
||||
png_structp dummy_ptr;
|
||||
|
||||
fprintf(STDERR, "\n Testing libpng version %s\n", PNG_LIBPNG_VER_STRING);
|
||||
fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION);
|
||||
fprintf(STDERR, "%s", png_get_copyright(NULL));
|
||||
@ -1994,6 +1996,24 @@ main(int argc, char *argv[])
|
||||
else
|
||||
fprintf(STDERR, " libpng FAILS test\n");
|
||||
|
||||
dummy_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
fprintf(STDERR, " Default limits:\n");
|
||||
fprintf(STDERR, " width_max = %lu\n",
|
||||
(unsigned long) png_get_user_width_max(dummy_ptr));
|
||||
fprintf(STDERR, " height_max = %lu\n",
|
||||
(unsigned long) png_get_user_height_max(dummy_ptr));
|
||||
if (png_get_chunk_cache_max(dummy_ptr) == 0)
|
||||
fprintf(STDERR, " cache_max = unlimited\n");
|
||||
else
|
||||
fprintf(STDERR, " cache_max = %lu\n",
|
||||
(unsigned long) png_get_chunk_cache_max(dummy_ptr));
|
||||
if (png_get_chunk_malloc_max(dummy_ptr) == 0)
|
||||
fprintf(STDERR, " malloc_max = unlimited\n");
|
||||
else
|
||||
fprintf(STDERR, " malloc_max = %lu\n",
|
||||
(unsigned long) png_get_chunk_malloc_max(dummy_ptr));
|
||||
png_destroy_read_struct(&dummy_ptr, NULL, NULL);
|
||||
|
||||
return (int)(ierror != 0);
|
||||
}
|
||||
#else
|
||||
|
||||
@ -12,4 +12,4 @@
|
||||
# @# 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 1000000
|
||||
# @# define PNG_USER_CHUNK_MALLOC_MAX 640000
|
||||
|
||||
@ -395,7 +395,7 @@ option USER_LIMITS requires READ
|
||||
# USER_CHUNK_CACHE_MAX limit
|
||||
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_CACHE_MAX default 1000 /* Use 0 for unlimited */
|
||||
setting USER_CHUNK_MALLOC_MAX default 8000000 /* Use 0 for unlimited */
|
||||
|
||||
# If this option is enabled APIs to set the above limits at run time are added;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* Libpng version 1.7.0beta51 - February 15, 2015 */
|
||||
/* Libpng version 1.7.0beta51 - February 17, 2015 */
|
||||
|
||||
/* Copyright (c) 1998-2014 Glenn Randers-Pehrson */
|
||||
|
||||
@ -197,7 +197,7 @@
|
||||
#define PNG_QUANTIZE_RED_BITS 5
|
||||
#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)
|
||||
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0
|
||||
#define PNG_USER_CHUNK_CACHE_MAX 128 /* Use 0 for unlimited */
|
||||
#define PNG_USER_CHUNK_CACHE_MAX 1000 /* Use 0 for unlimited */
|
||||
#define PNG_USER_CHUNK_MALLOC_MAX 8000000 /* Use 0 for unlimited */
|
||||
#define PNG_USER_HEIGHT_MAX 1000000 /* Use 0x7fffffff for unlimited */
|
||||
#define PNG_USER_WIDTH_MAX 1000000 /* Use 0x7fffffff for unlimited */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user