mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] tests backported from libpng 1.7
This updates libpng16 with all the test changes from libpng17, including changes to pngvalid.c to ensure that the original, distributed, version of contrib/visupng/cexcept.h can be used. pngvalid contains the correction to the use of SAVE/STORE_ UNKNOWN_CHUNKS; a bug revealed by changes in libpng 1.7. More tests contain the --strict option to detect warnings and the pngvalid-standard test has been corrected so that it does not turn on progresive-read (there is a separate test which does that.) Some signed/unsigned fixes have been made. Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
@@ -52,7 +52,10 @@
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
#include <setjmp.h>
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_EASY_ACCESS_SUPPORTED)
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_EASY_ACCESS_SUPPORTED) &&\
|
||||
(defined(PNG_READ_DEINTERLACE_SUPPORTED) ||\
|
||||
defined(PNG_READ_INTERLACING_SUPPORTED))
|
||||
|
||||
/* zlib.h defines the structure z_stream, an instance of which is included
|
||||
* in this structure and is required for decompressing the LZ compressed
|
||||
* data in PNG files.
|
||||
@@ -667,7 +670,7 @@ IDAT_list_extend(struct IDAT_list *tail)
|
||||
|
||||
if (length < tail->length) /* arithmetic overflow */
|
||||
length = tail->length;
|
||||
|
||||
|
||||
next = voidcast(IDAT_list*, malloc(IDAT_list_size(NULL, length)));
|
||||
CLEAR(*next);
|
||||
|
||||
@@ -921,7 +924,7 @@ emit_string(const char *str, FILE *out)
|
||||
|
||||
else if (isspace(UCHAR_MAX & *str))
|
||||
putc('_', out);
|
||||
|
||||
|
||||
else
|
||||
fprintf(out, "\\%.3o", *str);
|
||||
}
|
||||
@@ -1945,7 +1948,7 @@ process_IDAT(struct file *file)
|
||||
list->count = 0;
|
||||
file->idat->idat_list_tail = list;
|
||||
}
|
||||
|
||||
|
||||
/* And fill in the next IDAT information buffer. */
|
||||
list->lengths[(list->count)++] = file->chunk->chunk_length;
|
||||
|
||||
@@ -2585,7 +2588,7 @@ zlib_run(struct zlib *zlib)
|
||||
{
|
||||
struct chunk *chunk = zlib->chunk;
|
||||
int rc;
|
||||
|
||||
|
||||
assert(zlib->rewrite_offset < chunk->chunk_length);
|
||||
|
||||
rc = zlib_advance(zlib, chunk->chunk_length - zlib->rewrite_offset);
|
||||
@@ -4030,7 +4033,7 @@ main(void)
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
fprintf(stderr, "pngfix does not work without read support\n");
|
||||
fprintf(stderr, "pngfix does not work without read deinterlace support\n");
|
||||
return 77;
|
||||
}
|
||||
#endif /* PNG_READ_SUPPORTED && PNG_EASY_ACCESS_SUPPORTED */
|
||||
|
||||
Reference in New Issue
Block a user