[libpng17] Added libpng 1.5 checks to pngvalid.c

This commit is contained in:
John Bowler 2013-12-27 07:53:50 -06:00 committed by Glenn Randers-Pehrson
parent 8df7c46e5b
commit ad1a4c8cc3
3 changed files with 17 additions and 8 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.7.0beta26 - December 26, 2013
Libpng 1.7.0beta26 - December 27, 2013
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.
@ -468,7 +468,8 @@ Version 1.7.0beta25 [December 26, 2013]
Merged files with version 1.6.8 that have not changed since then.
Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
Version 1.7.0beta26 [December 26, 2013]
Version 1.7.0beta26 [December 27, 2013]
Added libpng 1.5 checks to pngvalid.c
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -4757,7 +4757,8 @@ Version 1.7.0beta25 [December 26, 2013]
Merged files with version 1.6.8 that have not changed since then.
Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
Version 1.7.0beta26 [December 26, 2013]
Version 1.7.0beta26 [December 27, 2013]
Added libpng 1.5 checks to pngvalid.c
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -4867,7 +4867,7 @@ standard_check_text(png_const_structp pp, png_const_textp tp,
static void
standard_text_validate(standard_display *dp, png_const_structp pp,
png_infop pi)
png_infop pi, int check_end)
{
png_textp tp = NULL;
png_uint_32 num_text = png_get_text(pp, pi, &tp, NULL);
@ -4875,6 +4875,12 @@ standard_text_validate(standard_display *dp, png_const_structp pp,
if (num_text == 2 && tp != NULL)
{
standard_check_text(pp, tp, "image name", dp->ps->current->name);
/* 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");
}
@ -4888,7 +4894,7 @@ standard_text_validate(standard_display *dp, png_const_structp pp,
}
}
#else
# define standard_text_validate(dp,pp,pi) ((void)0)
# define standard_text_validate(dp,pp,pi,check_end) ((void)0)
#endif
static void
@ -4978,7 +4984,8 @@ standard_end(png_structp ppIn, png_infop pi)
/* Validate the image - progressive reading only produces one variant for
* 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);
}
@ -5049,7 +5056,7 @@ standard_test(png_store* PNG_CONST psIn, png_uint_32 PNG_CONST id,
*/
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);
}
else