summaryrefslogtreecommitdiff
path: root/pngtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'pngtest.c')
-rw-r--r--pngtest.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/pngtest.c b/pngtest.c
index a3f7fb9ab..258c74130 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1,7 +1,7 @@
/* pngtest.c - a simple test program to test libpng
*
- * Last changed in libpng 1.2.51 [February 6, 2014]
+ * Last changed in libpng 1.2.53 [February 6, 2014]
* Copyright (c) 1998-2014 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.)
@@ -1456,6 +1456,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));
@@ -1698,8 +1700,34 @@ main(int argc, char *argv[])
fprintf(STDERR, " libpng passes test\n");
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");
+#ifdef PNG_SET_USER_LIMITS_SUPPORTED
+ 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));
+#else
+ fprintf(STDERR, " width_max = %lu\n",
+ (unsigned long) PNG_USER_WIDTH_MAX);
+ fprintf(STDERR, " height_max = %lu\n",
+ (unsigned long) PNG_USER_HEIGHT_MAX);
+#endif /* PNG_SET_USER_LIMITS_SUPPORTED */
+ if (PNG_USER_CHUNK_CACHE_MAX == 0)
+ fprintf(STDERR, " cache_max = unlimited\n");
+ else
+ fprintf(STDERR, " cache_max = %lu\n",
+ (unsigned long) PNG_USER_CHUNK_CACHE_MAX);
+ if (PNG_USER_CHUNK_MALLOC_MAX == 0)
+ fprintf(STDERR, " malloc_max = unlimited\n");
+ else
+ fprintf(STDERR, " malloc_max = %lu\n",
+ (unsigned long) PNG_USER_CHUNK_MALLOC_MAX);
+ png_destroy_read_struct(&dummy_ptr, NULL, NULL);
+
return (int)(ierror != 0);
}
/* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_0_62 your_png_h_is_not_version_1_0_62;
+typedef version_1_0_63 your_png_h_is_not_version_1_0_63;