IDAT read buffering correction

The sequential read code failed to read to the end of the IDAT stream in about
1/820 cases, resulting in a spurious warning.  The
png_set_compression_buffer_size API also would not work (or do bad things) if
the size of a zlib uInt was less than 32 bits.

This includes a quiet API change to alter png_set_compression_buffer_size to use
a png_alloc_size_t, not png_size_t and implement the correct checks.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2016-01-10 13:51:29 -08:00
parent e393f19527
commit 1afbb57994
5 changed files with 37 additions and 17 deletions

View File

@@ -576,7 +576,7 @@ struct png_struct_def
#endif
#if defined(PNG_SEQUENTIAL_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
uInt IDAT_size; /* limit on IDAT read and write IDAT size */
png_uint_32 IDAT_size; /* limit on IDAT read and write IDAT size */
#endif /* SEQUENTIAL_READ || WRITE */
/* ERROR HANDLING */