diff options
Diffstat (limited to 'plugins/AdvaImg/src/LibPNG/pngpread.c')
-rw-r--r-- | plugins/AdvaImg/src/LibPNG/pngpread.c | 260 |
1 files changed, 68 insertions, 192 deletions
diff --git a/plugins/AdvaImg/src/LibPNG/pngpread.c b/plugins/AdvaImg/src/LibPNG/pngpread.c index eec5983833..77c3873734 100644 --- a/plugins/AdvaImg/src/LibPNG/pngpread.c +++ b/plugins/AdvaImg/src/LibPNG/pngpread.c @@ -1,7 +1,7 @@ /* pngpread.c - read a png file in push mode
*
- * Last changed in libpng 1.6.10 [March 6, 2014]
+ * Last changed in libpng 1.6.15 [November 20, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -26,6 +26,13 @@ #define PNG_READ_iTXt_MODE 7
#define PNG_ERROR_MODE 8
+#define PNG_PUSH_SAVE_BUFFER_IF_FULL \
+if (png_ptr->push_length + 4 > png_ptr->buffer_size) \
+ { png_push_save_buffer(png_ptr); return; }
+#define PNG_PUSH_SAVE_BUFFER_IF_LT(N) \
+if (png_ptr->buffer_size < N) \
+ { png_push_save_buffer(png_ptr); return; }
+
void PNGAPI
png_process_data(png_structrp png_ptr, png_inforp info_ptr,
png_bytep buffer, png_size_t buffer_size)
@@ -46,10 +53,10 @@ png_process_data_pause(png_structrp png_ptr, int save) {
if (png_ptr != NULL)
{
- /* It's easiest for the caller if we do the save, then the caller doesn't
+ /* It's easiest for the caller if we do the save; then the caller doesn't
* have to supply the same data again:
*/
- if (save)
+ if (save != 0)
png_push_save_buffer(png_ptr);
else
{
@@ -189,23 +196,18 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) int keep; /* unknown handling method */
#endif
- /* First we make sure we have enough data for the 4 byte chunk name
- * and the 4 byte chunk length before proceeding with decoding the
+ /* First we make sure we have enough data for the 4-byte chunk name
+ * and the 4-byte chunk length before proceeding with decoding the
* chunk data. To fully decode each of these chunks, we also make
- * sure we have enough data in the buffer for the 4 byte CRC at the
+ * sure we have enough data in the buffer for the 4-byte CRC at the
* end of every chunk (except IDAT, which is handled separately).
*/
- if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
+ if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
{
png_byte chunk_length[4];
png_byte chunk_tag[4];
- if (png_ptr->buffer_size < 8)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_LT(8)
png_push_fill_buffer(png_ptr, chunk_length, 4);
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
png_reset_crc(png_ptr);
@@ -219,28 +221,28 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) if (chunk_name == png_IDAT)
{
- if (png_ptr->mode & PNG_AFTER_IDAT)
+ if ((png_ptr->mode & PNG_AFTER_IDAT) != 0)
png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
/* If we reach an IDAT chunk, this means we have read all of the
* header chunks, and we can start reading the image (or if this
* is called after the image has been read - we have an error).
*/
- if (!(png_ptr->mode & PNG_HAVE_IHDR))
+ if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
png_error(png_ptr, "Missing IHDR before IDAT");
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
- !(png_ptr->mode & PNG_HAVE_PLTE))
+ (png_ptr->mode & PNG_HAVE_PLTE) == 0)
png_error(png_ptr, "Missing PLTE before IDAT");
png_ptr->mode |= PNG_HAVE_IDAT;
png_ptr->process_mode = PNG_READ_IDAT_MODE;
- if (!(png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
+ if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0)
if (png_ptr->push_length == 0)
return;
- if (png_ptr->mode & PNG_AFTER_IDAT)
+ if ((png_ptr->mode & PNG_AFTER_IDAT) != 0)
png_benign_error(png_ptr, "Too many IDATs found");
}
@@ -249,23 +251,13 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) if (png_ptr->push_length != 13)
png_error(png_ptr, "Invalid IHDR length");
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
}
else if (chunk_name == png_IEND)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
png_ptr->process_mode = PNG_READ_DONE_MODE;
@@ -275,12 +267,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep);
if (chunk_name == png_PLTE)
@@ -290,11 +277,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) else if (chunk_name == png_PLTE)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -313,12 +296,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_gAMA_SUPPORTED
else if (png_ptr->chunk_name == png_gAMA)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -326,12 +304,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_sBIT_SUPPORTED
else if (png_ptr->chunk_name == png_sBIT)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -339,12 +312,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_cHRM_SUPPORTED
else if (png_ptr->chunk_name == png_cHRM)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -352,12 +320,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_sRGB_SUPPORTED
else if (chunk_name == png_sRGB)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -365,12 +328,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_iCCP_SUPPORTED
else if (png_ptr->chunk_name == png_iCCP)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -378,12 +336,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_sPLT_SUPPORTED
else if (chunk_name == png_sPLT)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -391,12 +344,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_tRNS_SUPPORTED
else if (chunk_name == png_tRNS)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -404,12 +352,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_bKGD_SUPPORTED
else if (chunk_name == png_bKGD)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -417,12 +360,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_hIST_SUPPORTED
else if (chunk_name == png_hIST)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -430,12 +368,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_pHYs_SUPPORTED
else if (chunk_name == png_pHYs)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -443,12 +376,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_oFFs_SUPPORTED
else if (chunk_name == png_oFFs)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
}
#endif
@@ -456,12 +384,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_pCAL_SUPPORTED
else if (chunk_name == png_pCAL)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -469,12 +392,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_sCAL_SUPPORTED
else if (chunk_name == png_sCAL)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -482,12 +400,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_tIME_SUPPORTED
else if (chunk_name == png_tIME)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -495,12 +408,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_tEXt_SUPPORTED
else if (chunk_name == png_tEXt)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -508,12 +416,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_zTXt_SUPPORTED
else if (chunk_name == png_zTXt)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
}
@@ -521,23 +424,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) #ifdef PNG_READ_iTXt_SUPPORTED
else if (chunk_name == png_iTXt)
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
}
#endif
else
{
- if (png_ptr->push_length + 4 > png_ptr->buffer_size)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length,
PNG_HANDLE_CHUNK_AS_DEFAULT);
}
@@ -555,7 +449,7 @@ png_push_crc_skip(png_structrp png_ptr, png_uint_32 skip) void /* PRIVATE */
png_push_crc_finish(png_structrp png_ptr)
{
- if (png_ptr->skip_length && png_ptr->save_buffer_size)
+ if (png_ptr->skip_length != 0 && png_ptr->save_buffer_size != 0)
{
png_size_t save_size = png_ptr->save_buffer_size;
png_uint_32 skip_length = png_ptr->skip_length;
@@ -579,7 +473,7 @@ png_push_crc_finish(png_structrp png_ptr) png_ptr->save_buffer_size -= save_size;
png_ptr->save_buffer_ptr += save_size;
}
- if (png_ptr->skip_length && png_ptr->current_buffer_size)
+ if (png_ptr->skip_length != 0 && png_ptr->current_buffer_size != 0)
{
png_size_t save_size = png_ptr->current_buffer_size;
png_uint_32 skip_length = png_ptr->skip_length;
@@ -600,14 +494,9 @@ png_push_crc_finish(png_structrp png_ptr) png_ptr->current_buffer_size -= save_size;
png_ptr->current_buffer_ptr += save_size;
}
- if (!png_ptr->skip_length)
+ if (png_ptr->skip_length == 0)
{
- if (png_ptr->buffer_size < 4)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_LT(4)
png_crc_finish(png_ptr, 0);
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
}
@@ -622,7 +511,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) return;
ptr = buffer;
- if (png_ptr->save_buffer_size)
+ if (png_ptr->save_buffer_size != 0)
{
png_size_t save_size;
@@ -639,7 +528,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) png_ptr->save_buffer_size -= save_size;
png_ptr->save_buffer_ptr += save_size;
}
- if (length && png_ptr->current_buffer_size)
+ if (length != 0 && png_ptr->current_buffer_size != 0)
{
png_size_t save_size;
@@ -659,7 +548,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) void /* PRIVATE */
png_push_save_buffer(png_structrp png_ptr)
{
- if (png_ptr->save_buffer_size)
+ if (png_ptr->save_buffer_size != 0)
{
if (png_ptr->save_buffer_ptr != png_ptr->save_buffer)
{
@@ -695,11 +584,13 @@ png_push_save_buffer(png_structrp png_ptr) if (png_ptr->save_buffer == NULL)
{
png_free(png_ptr, old_buffer);
+ old_buffer = NULL;
png_error(png_ptr, "Insufficient memory for save_buffer");
}
memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
png_free(png_ptr, old_buffer);
+ old_buffer = NULL;
png_ptr->save_buffer_max = new_max;
}
if (png_ptr->current_buffer_size)
@@ -726,18 +617,13 @@ png_push_restore_buffer(png_structrp png_ptr, png_bytep buffer, void /* PRIVATE */
png_push_read_IDAT(png_structrp png_ptr)
{
- if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
+ if ((png_ptr->mode & PNG_HAVE_CHUNK_HEADER) == 0)
{
png_byte chunk_length[4];
png_byte chunk_tag[4];
/* TODO: this code can be commoned up with the same code in push_read */
- if (png_ptr->buffer_size < 8)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_LT(8)
png_push_fill_buffer(png_ptr, chunk_length, 4);
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
png_reset_crc(png_ptr);
@@ -749,7 +635,7 @@ png_push_read_IDAT(png_structrp png_ptr) {
png_ptr->process_mode = PNG_READ_CHUNK_MODE;
- if (!(png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED))
+ if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0)
png_error(png_ptr, "Not enough compressed data");
return;
@@ -758,7 +644,7 @@ png_push_read_IDAT(png_structrp png_ptr) png_ptr->idat_size = png_ptr->push_length;
}
- if (png_ptr->idat_size && png_ptr->save_buffer_size)
+ if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0)
{
png_size_t save_size = png_ptr->save_buffer_size;
png_uint_32 idat_size = png_ptr->idat_size;
@@ -785,7 +671,7 @@ png_push_read_IDAT(png_structrp png_ptr) png_ptr->save_buffer_ptr += save_size;
}
- if (png_ptr->idat_size && png_ptr->current_buffer_size)
+ if (png_ptr->idat_size != 0 && png_ptr->current_buffer_size != 0)
{
png_size_t save_size = png_ptr->current_buffer_size;
png_uint_32 idat_size = png_ptr->idat_size;
@@ -810,14 +696,9 @@ png_push_read_IDAT(png_structrp png_ptr) png_ptr->current_buffer_size -= save_size;
png_ptr->current_buffer_ptr += save_size;
}
- if (!png_ptr->idat_size)
+ if (png_ptr->idat_size == 0)
{
- if (png_ptr->buffer_size < 4)
- {
- png_push_save_buffer(png_ptr);
- return;
- }
-
+ PNG_PUSH_SAVE_BUFFER_IF_LT(4)
png_crc_finish(png_ptr, 0);
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
png_ptr->mode |= PNG_AFTER_IDAT;
@@ -962,7 +843,7 @@ png_push_process_row(png_structrp png_ptr) memcpy(png_ptr->prev_row, png_ptr->row_buf, row_info.rowbytes + 1);
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
- if (png_ptr->transformations)
+ if (png_ptr->transformations != 0)
png_do_read_transformations(png_ptr, &row_info);
#endif
@@ -979,15 +860,16 @@ png_push_process_row(png_structrp png_ptr) #ifdef PNG_READ_INTERLACING_SUPPORTED
- /* Blow up interlaced rows to full size */
- if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
+ /* Expand interlaced rows to full size */
+ if (png_ptr->interlaced != 0 &&
+ (png_ptr->transformations & PNG_INTERLACE) != 0)
{
if (png_ptr->pass < 6)
png_do_read_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass,
png_ptr->transformations);
- switch (png_ptr->pass)
- {
+ switch (png_ptr->pass)
+ {
case 0:
{
int i;
@@ -1154,7 +1036,6 @@ png_push_process_row(png_structrp png_ptr) }
}
else
-#endif
{
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
png_read_push_finish_row(png_ptr);
@@ -1164,7 +1045,6 @@ png_push_process_row(png_structrp png_ptr) void /* PRIVATE */
png_read_push_finish_row(png_structrp png_ptr)
{
-#ifdef PNG_READ_INTERLACING_SUPPORTED
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Start of interlace block */
@@ -1189,8 +1069,7 @@ png_read_push_finish_row(png_structrp png_ptr) if (png_ptr->row_number < png_ptr->num_rows)
return;
-#ifdef PNG_READ_INTERLACING_SUPPORTED
- if (png_ptr->interlaced)
+ if (png_ptr->interlaced != 0)
{
png_ptr->row_number = 0;
memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
@@ -1214,7 +1093,7 @@ png_read_push_finish_row(png_structrp png_ptr) png_pass_start[png_ptr->pass]) /
png_pass_inc[png_ptr->pass];
- if (png_ptr->transformations & PNG_INTERLACE)
+ if ((png_ptr->transformations & PNG_INTERLACE) != 0)
break;
png_ptr->num_rows = (png_ptr->height +
@@ -1224,7 +1103,6 @@ png_read_push_finish_row(png_structrp png_ptr) } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0);
}
-#endif /* PNG_READ_INTERLACING_SUPPORTED */
}
void /* PRIVATE */
@@ -1249,7 +1127,6 @@ png_push_have_row(png_structrp png_ptr, png_bytep row) (int)png_ptr->pass);
}
-#ifdef PNG_READ_INTERLACING_SUPPORTED
void PNGAPI
png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row,
png_const_bytep new_row)
@@ -1262,9 +1139,8 @@ png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row, * it must be png_ptr->row_buf+1
*/
if (new_row != NULL)
- png_combine_row(png_ptr, old_row, 1/*display*/);
+ png_combine_row(png_ptr, old_row, 1/*blocky display*/);
}
-#endif /* PNG_READ_INTERLACING_SUPPORTED */
void PNGAPI
png_set_progressive_read_fn(png_structrp png_ptr, png_voidp progressive_ptr,
@@ -1289,4 +1165,4 @@ png_get_progressive_ptr(png_const_structrp png_ptr) return png_ptr->io_ptr;
}
-#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
+#endif /* PROGRESSIVE_READ */
|