[libpng16] Added checks for libpng 1.5 to pngvalid.c. This supports the use of

this version of pngvalid in libpng 1.5
This commit is contained in:
John Bowler
2013-12-27 08:14:06 -06:00
committed by Glenn Randers-Pehrson
parent 79f0ba499f
commit 1d3c990425
3 changed files with 25 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
Libpng 1.6.9beta02 - December 26, 2013 Libpng 1.6.9beta02 - December 27, 2013
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@@ -42,7 +42,9 @@ Version 1.6.9beta01 [December 26, 2013]
Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69 Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
in the tar distributions. in the tar distributions.
Version 1.6.9beta02 [December 26, 2013] Version 1.6.9beta02 [December 27, 2013]
Added checks for libpng 1.5 to pngvalid.c. This supports the use of
this version of pngvalid in libpng 1.5
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@@ -4767,7 +4767,9 @@ Version 1.6.9beta01 [December 26, 2013]
Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69 Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
in the tar distributions. in the tar distributions.
Version 1.6.9beta02 [December 26, 2013] Version 1.6.9beta02 [December 27, 2013]
Added checks for libpng 1.5 to pngvalid.c. This supports the use of
this version of pngvalid in libpng 1.5
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@@ -1,7 +1,7 @@
/* pngvalid.c - validate libpng by constructing then reading png files. /* pngvalid.c - validate libpng by constructing then reading png files.
* *
* Last changed in libpng 1.6.8 [December 19, 2013] * Last changed in libpng 1.6.9 [(PENDING RELEASE)]
* Copyright (c) 2013 Glenn Randers-Pehrson * Copyright (c) 2013 Glenn Randers-Pehrson
* Written by John Cunningham Bowler * Written by John Cunningham Bowler
* *
@@ -4849,7 +4849,7 @@ standard_check_text(png_const_structp pp, png_const_textp tp,
static void static void
standard_text_validate(standard_display *dp, png_const_structp pp, standard_text_validate(standard_display *dp, png_const_structp pp,
png_infop pi) png_infop pi, int check_end)
{ {
png_textp tp = NULL; png_textp tp = NULL;
png_uint_32 num_text = png_get_text(pp, pi, &tp, NULL); png_uint_32 num_text = png_get_text(pp, pi, &tp, NULL);
@@ -4857,7 +4857,13 @@ standard_text_validate(standard_display *dp, png_const_structp pp,
if (num_text == 2 && tp != NULL) if (num_text == 2 && tp != NULL)
{ {
standard_check_text(pp, tp, "image name", dp->ps->current->name); standard_check_text(pp, tp, "image name", dp->ps->current->name);
standard_check_text(pp, tp+1, "end marker", "end");
/* This exists because prior to 1.6 the progressive reader left the
* png_struct z_stream unreset at the end of the image, so subsequent
* attempts to use it simply returns Z_STREAM_END.
*/
if (check_end)
standard_check_text(pp, tp+1, "end marker", "end");
} }
else else
@@ -4870,7 +4876,7 @@ standard_text_validate(standard_display *dp, png_const_structp pp,
} }
} }
#else #else
# define standard_text_validate(dp,pp,pi) ((void)0) # define standard_text_validate(dp,pp,pi,check_end) ((void)0)
#endif #endif
static void static void
@@ -4960,7 +4966,8 @@ standard_end(png_structp ppIn, png_infop pi)
/* Validate the image - progressive reading only produces one variant for /* Validate the image - progressive reading only produces one variant for
* interlaced images. * interlaced images.
*/ */
standard_text_validate(dp, pp, pi); standard_text_validate(dp, pp, pi,
PNG_LIBPNG_VER >= 10600/*check_end: see comments above*/);
standard_image_validate(dp, pp, 0, -1); standard_image_validate(dp, pp, 0, -1);
} }
@@ -5031,7 +5038,7 @@ standard_test(png_store* PNG_CONST psIn, png_uint_32 PNG_CONST id,
*/ */
if (!d.speed) if (!d.speed)
{ {
standard_text_validate(&d, pp, pi); standard_text_validate(&d, pp, pi, 1/*check_end*/);
standard_image_validate(&d, pp, 0, 1); standard_image_validate(&d, pp, 0, 1);
} }
else else
@@ -10276,6 +10283,11 @@ int main(void)
fprintf(stderr, fprintf(stderr,
"pngvalid: no low level write support in libpng, all tests skipped\n"); "pngvalid: no low level write support in libpng, all tests skipped\n");
/* So the test is skipped: */ /* So the test is skipped: */
#if PNG_LIBPNG_VER < 10601
/* Test harness support was only added in libpng 1.6.1: */
return 0;
#else
return 77; return 77;
#endif
} }
#endif #endif