mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] IDAT compression failed if preceded by a compressed text chunk
This was because the attempt to reset the zlib stream in png_write_IDAT happened after the first IDAT chunk had been deflated - much too late. In this change internal functions are added to claim/release the z_stream and, hopefully, make the code more robust. Also deflateEnd checking is added - previously libpng would ignore an error at the end of the stream.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
c559bb58ed
commit
c5bef946b1
2
png.h
2
png.h
@@ -1394,6 +1394,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
|
||||
#define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */
|
||||
#define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
/* Set the library compression level. Currently, valid values range from
|
||||
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9
|
||||
* (0 - no compression, 9 - "maximal" compression). Note that tests have
|
||||
@@ -1415,6 +1416,7 @@ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structp png_ptr,
|
||||
|
||||
PNG_EXPORT(73, void, png_set_compression_method, (png_structp png_ptr,
|
||||
int method));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
|
||||
/* Also set zlib parameters for compressing non-IDAT chunks */
|
||||
|
||||
Reference in New Issue
Block a user