mirror of
				https://git.code.sf.net/p/libpng/code.git
				synced 2025-07-10 18:04:09 +02:00 
			
		
		
		
	[libpng17] Changed "#endif /* PNG_FEATURE_SUPPORTED */" to "#endif /* FEATURE */"
This commit is contained in:
		
							parent
							
								
									9c0b5ab848
								
							
						
					
					
						commit
						aeb4a22975
					
				
							
								
								
									
										2
									
								
								ANNOUNCE
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								ANNOUNCE
									
									
									
									
									
								
							@ -644,8 +644,6 @@ Version 1.7.0beta40 [November 6, 2014]
 | 
			
		||||
    warnings go away.
 | 
			
		||||
 | 
			
		||||
Version 1.7.0beta41 [November 7, 2014]
 | 
			
		||||
  Removed #ifdef PNG_16BIT_SUPPORTED/#endif around png_product2(); it is
 | 
			
		||||
    needed by png_reciprocal2().
 | 
			
		||||
  Added #ifdef PNG_16BIT_SUPPORTED/#endif around png_log16bit() and
 | 
			
		||||
    png_do_swap().
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								CHANGES
									
									
									
									
									
								
							@ -4933,8 +4933,6 @@ Version 1.7.0beta40 [November 6, 2014]
 | 
			
		||||
    warnings go away.
 | 
			
		||||
 | 
			
		||||
Version 1.7.0beta41 [November 7, 2014]
 | 
			
		||||
  Removed #ifdef PNG_16BIT_SUPPORTED/#endif around png_product2(); it is
 | 
			
		||||
    needed by png_reciprocal2().
 | 
			
		||||
  Added #ifdef PNG_16BIT_SUPPORTED/#endif around png_log16bit() and
 | 
			
		||||
    png_do_swap().
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -494,7 +494,7 @@ void read_png(FILE *fp, unsigned int sig_read)  /* File is already open */
 | 
			
		||||
                        max_screen_colors, histogram, 0);
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
 | 
			
		||||
#endif /* READ_QUANTIZE */
 | 
			
		||||
 | 
			
		||||
   /* Invert monochrome files to have 0 as white and 1 as black */
 | 
			
		||||
   png_set_invert_mono(png_ptr);
 | 
			
		||||
@ -532,7 +532,7 @@ void read_png(FILE *fp, unsigned int sig_read)  /* File is already open */
 | 
			
		||||
   number_passes = png_set_interlace_handling(png_ptr);
 | 
			
		||||
#else
 | 
			
		||||
   number_passes = 1;
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
   /* Optional call to gamma correct and add the background to the palette
 | 
			
		||||
@ -744,7 +744,7 @@ row_callback(png_structp png_ptr, png_bytep new_row,
 | 
			
		||||
    * to pass the current row as new_row, and the function will combine
 | 
			
		||||
    * the old row and the new row.
 | 
			
		||||
    */
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
end_callback(png_structp png_ptr, png_infop info)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								png.c
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								png.c
									
									
									
									
									
								
							@ -65,7 +65,7 @@ png_sig_cmp(png_const_bytep sig, png_size_t start, png_size_t num_to_check)
 | 
			
		||||
   return ((int)(memcmp(&sig[start], &png_signature[start], num_to_check)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED */
 | 
			
		||||
#endif /* READ */
 | 
			
		||||
 | 
			
		||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
 | 
			
		||||
/* Function to allocate memory for zlib */
 | 
			
		||||
@ -576,7 +576,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
 | 
			
		||||
 | 
			
		||||
   info_ptr->free_me &= ~mask;
 | 
			
		||||
}
 | 
			
		||||
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
 | 
			
		||||
#endif /* READ || WRITE */
 | 
			
		||||
 | 
			
		||||
/* This function returns a pointer to the io_ptr associated with the user
 | 
			
		||||
 * functions.  The application should free any memory associated with this
 | 
			
		||||
@ -680,7 +680,7 @@ png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime)
 | 
			
		||||
}
 | 
			
		||||
#  endif /* PNG_TIME_RFC1123_SUPPORTED */
 | 
			
		||||
 | 
			
		||||
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
 | 
			
		||||
#endif /* READ || WRITE */
 | 
			
		||||
 | 
			
		||||
png_const_charp PNGAPI
 | 
			
		||||
png_get_copyright(png_const_structrp png_ptr)
 | 
			
		||||
@ -2261,7 +2261,7 @@ png_icc_set_sRGB(png_const_structrp png_ptr,
 | 
			
		||||
      (void)png_colorspace_set_sRGB(png_ptr, colorspace,
 | 
			
		||||
         (int)/*already checked*/png_get_uint_32(profile+64));
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_sRGB_SUPPORTED */
 | 
			
		||||
#endif /* READ_sRGB */
 | 
			
		||||
 | 
			
		||||
int /* PRIVATE */
 | 
			
		||||
png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
 | 
			
		||||
@ -3276,8 +3276,8 @@ png_gamma_significant(png_fixed_point gamma_val)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_GAMMA_SUPPORTED
 | 
			
		||||
#ifndef PNG_FLOATING_ARITHMETIC_SUPPORTED
 | 
			
		||||
/* A local convenience routine. */
 | 
			
		||||
#if defined(PNG_16BIT_SUPPORTED) || !defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
 | 
			
		||||
static png_fixed_point
 | 
			
		||||
png_product2(png_fixed_point a, png_fixed_point b)
 | 
			
		||||
{
 | 
			
		||||
@ -3298,7 +3298,7 @@ png_product2(png_fixed_point a, png_fixed_point b)
 | 
			
		||||
 | 
			
		||||
   return 0; /* overflow */
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_16BIT_SUPPORTED || !PNG_FLOATING_ARITHMETIC_SUPPORTED */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* The inverse of the above. */
 | 
			
		||||
png_fixed_point
 | 
			
		||||
@ -4470,4 +4470,4 @@ png_image_error(png_imagep image, png_const_charp error_message)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* SIMPLIFIED READ/WRITE */
 | 
			
		||||
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
 | 
			
		||||
#endif /* REA) || WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										18
									
								
								pngerror.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								pngerror.c
									
									
									
									
									
								
							@ -27,7 +27,7 @@ static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr,
 | 
			
		||||
static void /* PRIVATE */
 | 
			
		||||
png_default_warning PNGARG((png_const_structrp png_ptr,
 | 
			
		||||
   png_const_charp warning_message));
 | 
			
		||||
#endif /* PNG_WARNINGS_SUPPORTED */
 | 
			
		||||
#endif /* WARNINGS */
 | 
			
		||||
 | 
			
		||||
/* This function is called whenever there is a fatal error.  This function
 | 
			
		||||
 * should not be changed.  If there is a need to handle errors differently,
 | 
			
		||||
@ -103,7 +103,7 @@ png_err,(png_const_structrp png_ptr),PNG_NORETURN)
 | 
			
		||||
      use the default handler, which will not return. */
 | 
			
		||||
   png_default_error(png_ptr, "");
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_ERROR_TEXT_SUPPORTED */
 | 
			
		||||
#endif /* ERROR_TEXT */
 | 
			
		||||
 | 
			
		||||
/* Utility to safely appends strings to a buffer.  This never errors out so
 | 
			
		||||
 * error checking is not required in the caller.
 | 
			
		||||
@ -355,7 +355,7 @@ png_formatted_warning(png_const_structrp png_ptr, png_warning_parameters p,
 | 
			
		||||
    */
 | 
			
		||||
   png_warning(png_ptr, msg);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WARNINGS_SUPPORTED */
 | 
			
		||||
#endif /* WARNINGS */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
 | 
			
		||||
void PNGAPI
 | 
			
		||||
@ -473,7 +473,7 @@ png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
 | 
			
		||||
      buffer[iout] = '\0';
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */
 | 
			
		||||
#endif /* WARNINGS || ERROR_TEXT */
 | 
			
		||||
 | 
			
		||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED)
 | 
			
		||||
PNG_FUNCTION(void,PNGAPI
 | 
			
		||||
@ -490,7 +490,7 @@ png_chunk_error,(png_const_structrp png_ptr, png_const_charp error_message),
 | 
			
		||||
      png_error(png_ptr, msg);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED && PNG_ERROR_TEXT_SUPPORTED */
 | 
			
		||||
#endif /* READ && ERROR_TEXT */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_WARNINGS_SUPPORTED
 | 
			
		||||
void PNGAPI
 | 
			
		||||
@ -506,7 +506,7 @@ png_chunk_warning(png_const_structrp png_ptr, png_const_charp warning_message)
 | 
			
		||||
      png_warning(png_ptr, msg);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WARNINGS_SUPPORTED */
 | 
			
		||||
#endif /* WARNINGS */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_SUPPORTED
 | 
			
		||||
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
 | 
			
		||||
@ -525,7 +525,7 @@ png_chunk_benign_error(png_const_structrp png_ptr, png_const_charp
 | 
			
		||||
#  endif
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED */
 | 
			
		||||
#endif /* READ */
 | 
			
		||||
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
png_chunk_report(png_const_structrp png_ptr, png_const_charp message, int error)
 | 
			
		||||
@ -834,7 +834,7 @@ png_default_warning(png_const_structrp png_ptr, png_const_charp warning_message)
 | 
			
		||||
#endif
 | 
			
		||||
   PNG_UNUSED(png_ptr) /* Make compiler happy */
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WARNINGS_SUPPORTED */
 | 
			
		||||
#endif /* WARNINGS */
 | 
			
		||||
 | 
			
		||||
/* This function is called when the application wants to use another method
 | 
			
		||||
 * of handling errors and warnings.  Note that the error function MUST NOT
 | 
			
		||||
@ -970,4 +970,4 @@ png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)
 | 
			
		||||
   return result;
 | 
			
		||||
}
 | 
			
		||||
#endif /* SIMPLIFIED READ/WRITE */
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* READ || WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								pngget.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								pngget.c
									
									
									
									
									
								
							@ -455,12 +455,12 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr,
 | 
			
		||||
 | 
			
		||||
   return (retval);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_pHYs_SUPPORTED */
 | 
			
		||||
#endif  /* PNG_INCH_CONVERSIONS_SUPPORTED */
 | 
			
		||||
#endif /* pHYs */
 | 
			
		||||
#endif  /* INCH_CONVERSIONS */
 | 
			
		||||
 | 
			
		||||
/* png_get_channels really belongs in here, too, but it's been around longer */
 | 
			
		||||
 | 
			
		||||
#endif  /* PNG_EASY_ACCESS_SUPPORTED */
 | 
			
		||||
#endif  /* EASY_ACCESS */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
png_byte PNGAPI
 | 
			
		||||
@ -1181,7 +1181,7 @@ png_get_chunk_malloc_max (png_const_structrp png_ptr)
 | 
			
		||||
{
 | 
			
		||||
   return (png_ptr ? png_ptr->user_chunk_malloc_max : 0);
 | 
			
		||||
}
 | 
			
		||||
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
 | 
			
		||||
#endif /* ?SET_USER_LIMITS */
 | 
			
		||||
 | 
			
		||||
/* These functions were added to libpng 1.4.0 */
 | 
			
		||||
#ifdef PNG_IO_STATE_SUPPORTED
 | 
			
		||||
@ -1196,7 +1196,7 @@ png_get_io_chunk_type (png_const_structrp png_ptr)
 | 
			
		||||
{
 | 
			
		||||
   return png_ptr->chunk_name;
 | 
			
		||||
}
 | 
			
		||||
#endif /* ?PNG_IO_STATE_SUPPORTED */
 | 
			
		||||
#endif /* ?IO_STATE */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
 | 
			
		||||
#  ifdef PNG_GET_PALETTE_MAX_SUPPORTED
 | 
			
		||||
@ -1211,4 +1211,4 @@ png_get_palette_max(png_const_structrp png_ptr, png_const_inforp info_ptr)
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* READ || WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								pngmem.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								pngmem.c
									
									
									
									
									
								
							@ -225,7 +225,7 @@ png_free(png_const_structrp png_ptr, png_voidp ptr)
 | 
			
		||||
      png_ptr->free_fn(png_constcast(png_structrp,png_ptr), ptr);
 | 
			
		||||
 | 
			
		||||
   else
 | 
			
		||||
#endif /* PNG_USER_MEM_SUPPORTED */
 | 
			
		||||
#endif /* USER_MEM */
 | 
			
		||||
      free(ptr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -257,5 +257,5 @@ png_get_mem_ptr(png_const_structrp png_ptr)
 | 
			
		||||
 | 
			
		||||
   return png_ptr->mem_ptr;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_USER_MEM_SUPPORTED */
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* USER_MEM */
 | 
			
		||||
#endif /* READ || WRITE */
 | 
			
		||||
 | 
			
		||||
@ -1106,7 +1106,7 @@ png_read_push_finish_row(png_structrp png_ptr)
 | 
			
		||||
 | 
			
		||||
      } while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0);
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
@ -1146,7 +1146,7 @@ png_progressive_combine_row(png_const_structrp png_ptr, png_bytep old_row,
 | 
			
		||||
   if (new_row != NULL)
 | 
			
		||||
      png_combine_row(png_ptr, old_row, 1/*blocky display*/);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
 | 
			
		||||
void PNGAPI
 | 
			
		||||
png_set_progressive_read_fn(png_structrp png_ptr, png_voidp progressive_ptr,
 | 
			
		||||
@ -1171,4 +1171,4 @@ png_get_progressive_ptr(png_const_structrp png_ptr)
 | 
			
		||||
 | 
			
		||||
   return png_ptr->io_ptr;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
 | 
			
		||||
#endif /* PROGRESSIVE_READ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										30
									
								
								pngread.c
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								pngread.c
									
									
									
									
									
								
							@ -44,7 +44,7 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
 | 
			
		||||
{
 | 
			
		||||
   png_structp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
 | 
			
		||||
      error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
 | 
			
		||||
#endif /* PNG_USER_MEM_SUPPORTED */
 | 
			
		||||
#endif /* USER_MEM */
 | 
			
		||||
 | 
			
		||||
   if (png_ptr != NULL)
 | 
			
		||||
   {
 | 
			
		||||
@ -252,7 +252,7 @@ png_read_info(png_structrp png_ptr, png_inforp info_ptr)
 | 
			
		||||
            PNG_HANDLE_CHUNK_AS_DEFAULT);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
/* Optional call to update the users info_ptr structure */
 | 
			
		||||
void PNGAPI
 | 
			
		||||
@ -302,7 +302,7 @@ png_start_read_image(png_structrp png_ptr)
 | 
			
		||||
            "png_start_read_image/png_read_update_info: duplicate call");
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 | 
			
		||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
 | 
			
		||||
@ -369,7 +369,7 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */
 | 
			
		||||
#endif /* MNG_FEATURES */
 | 
			
		||||
 | 
			
		||||
void PNGAPI
 | 
			
		||||
png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
 | 
			
		||||
@ -436,7 +436,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
 | 
			
		||||
      png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined");
 | 
			
		||||
#endif
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_WARNINGS_SUPPORTED */
 | 
			
		||||
#endif /* WARNINGS */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
 | 
			
		||||
   /* If interlaced and we do not need a new row, combine row and return.
 | 
			
		||||
@ -605,7 +605,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
 | 
			
		||||
      (*(png_ptr->read_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 | 
			
		||||
/* Read one or more rows of image data.  If the image is interlaced,
 | 
			
		||||
@ -672,7 +672,7 @@ png_read_rows(png_structrp png_ptr, png_bytepp row,
 | 
			
		||||
         dp++;
 | 
			
		||||
      }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 | 
			
		||||
/* Read the entire image.  If the image has an alpha channel or a tRNS
 | 
			
		||||
@ -746,7 +746,7 @@ png_read_image(png_structrp png_ptr, png_bytepp image)
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
 | 
			
		||||
/* Read the end of the PNG file.  Will not read past the end of the
 | 
			
		||||
@ -912,7 +912,7 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr)
 | 
			
		||||
            PNG_HANDLE_CHUNK_AS_DEFAULT);
 | 
			
		||||
   } while ((png_ptr->mode & PNG_HAVE_IEND) == 0);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
/* Free all memory used in the read struct */
 | 
			
		||||
static void
 | 
			
		||||
@ -1220,8 +1220,8 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
 | 
			
		||||
 | 
			
		||||
   PNG_UNUSED(params)
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_INFO_IMAGE_SUPPORTED */
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* INFO_IMAGE */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_SIMPLIFIED_READ_SUPPORTED
 | 
			
		||||
/* SIMPLIFIED READ
 | 
			
		||||
@ -1507,7 +1507,7 @@ png_image_begin_read_from_file(png_imagep image, const char *file_name)
 | 
			
		||||
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_STDIO_SUPPORTED */
 | 
			
		||||
#endif /* STDIO */
 | 
			
		||||
 | 
			
		||||
static void PNGCBAPI
 | 
			
		||||
png_image_memory_read(png_structp png_ptr, png_bytep out, png_size_t need)
 | 
			
		||||
@ -1625,7 +1625,7 @@ png_image_skip_unused_chunks(png_structrp png_ptr)
 | 
			
		||||
#  define PNG_SKIP_CHUNKS(p) png_image_skip_unused_chunks(p)
 | 
			
		||||
#else
 | 
			
		||||
#  define PNG_SKIP_CHUNKS(p) ((void)0)
 | 
			
		||||
#endif /* PNG_HANDLE_AS_UNKNOWN_SUPPORTED */
 | 
			
		||||
#endif /* HANDLE_AS_UNKNOWN */
 | 
			
		||||
 | 
			
		||||
/* The following macro gives the exact rounded answer for all values in the
 | 
			
		||||
 * range 0..255 (it actually divides by 51.2, but the rounding still generates
 | 
			
		||||
@ -4116,5 +4116,5 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
 | 
			
		||||
   return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED */
 | 
			
		||||
#endif /* SIMPLIFIED_READ */
 | 
			
		||||
#endif /* READ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								pngrio.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pngrio.c
									
									
									
									
									
								
							@ -117,4 +117,4 @@ png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
 | 
			
		||||
   png_ptr->output_flush_fn = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED */
 | 
			
		||||
#endif /* READ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										24
									
								
								pngrtran.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								pngrtran.c
									
									
									
									
									
								
							@ -791,7 +791,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
 | 
			
		||||
      png_free(png_ptr, distance);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
 | 
			
		||||
#endif /* READ_QUANTIZE */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_GAMMA_SUPPORTED
 | 
			
		||||
void PNGFAPI
 | 
			
		||||
@ -912,7 +912,7 @@ png_set_tRNS_to_alpha(png_structrp png_ptr)
 | 
			
		||||
 | 
			
		||||
   png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
 | 
			
		||||
}
 | 
			
		||||
#endif /* defined(PNG_READ_EXPAND_SUPPORTED) */
 | 
			
		||||
#endif /* READ_EXPAND */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
 | 
			
		||||
/* Expand to 16-bit channels, expand the tRNS chunk too (because otherwise
 | 
			
		||||
@ -1695,7 +1695,7 @@ png_init_read_transformations(png_structrp png_ptr)
 | 
			
		||||
 | 
			
		||||
      else
 | 
			
		||||
      /* Transformation does not include PNG_BACKGROUND */
 | 
			
		||||
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
 | 
			
		||||
#endif /* READ_BACKGROUND */
 | 
			
		||||
      if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE
 | 
			
		||||
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
 | 
			
		||||
         /* RGB_TO_GRAY needs to have non-gamma-corrected values! */
 | 
			
		||||
@ -1725,7 +1725,7 @@ png_init_read_transformations(png_structrp png_ptr)
 | 
			
		||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
 | 
			
		||||
   else
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* PNG_READ_GAMMA_SUPPORTED */
 | 
			
		||||
#endif /* READ_GAMMA */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
 | 
			
		||||
   /* No GAMMA transformation (see the hanging else 4 lines above) */
 | 
			
		||||
@ -1764,7 +1764,7 @@ png_init_read_transformations(png_structrp png_ptr)
 | 
			
		||||
 | 
			
		||||
      png_ptr->transformations &= ~PNG_COMPOSE;
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
 | 
			
		||||
#endif /* READ_BACKGROUND */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_SHIFT_SUPPORTED
 | 
			
		||||
   if ((png_ptr->transformations & PNG_SHIFT) != 0 &&
 | 
			
		||||
@ -1810,7 +1810,7 @@ png_init_read_transformations(png_structrp png_ptr)
 | 
			
		||||
            png_ptr->palette[i].blue = (png_byte)component;
 | 
			
		||||
         }
 | 
			
		||||
   }
 | 
			
		||||
#endif  /* PNG_READ_SHIFT_SUPPORTED */
 | 
			
		||||
#endif  /* READ_SHIFT */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Modify the info structure to reflect the transformations.  The
 | 
			
		||||
@ -1915,7 +1915,7 @@ png_read_transform_info(png_structrp png_ptr, png_inforp info_ptr)
 | 
			
		||||
            CONFIGURATION ERROR: you must enable at least one 16 to 8 method
 | 
			
		||||
#        endif
 | 
			
		||||
#    endif
 | 
			
		||||
#endif /* !READ_16BIT_SUPPORTED */
 | 
			
		||||
#endif /* !READ_16BIT */
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
 | 
			
		||||
@ -3826,7 +3826,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_BACKGROUND_SUPPORTED || PNG_READ_ALPHA_MODE_SUPPORTED */
 | 
			
		||||
#endif /* READ_BACKGROUND || READ_ALPHA_MODE */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_GAMMA_SUPPORTED
 | 
			
		||||
/* Gamma correct the image, avoiding the alpha channel.  Make sure
 | 
			
		||||
@ -4586,7 +4586,7 @@ png_do_quantize(png_row_infop row_info, png_bytep row,
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
 | 
			
		||||
#endif /* READ_QUANTIZE */
 | 
			
		||||
 | 
			
		||||
/* Transform the row.  The order of transformations is significant,
 | 
			
		||||
 * and is very touchy.  If you add a transformation, take care to
 | 
			
		||||
@ -4781,7 +4781,7 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
 | 
			
		||||
      if (row_info->rowbytes == 0)
 | 
			
		||||
         png_error(png_ptr, "png_do_quantize returned rowbytes=0");
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
 | 
			
		||||
#endif /* READ_QUANTIZE */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
 | 
			
		||||
   /* Do the expansion now, after all the arithmetic has been done.  Notice
 | 
			
		||||
@ -4884,5 +4884,5 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED */
 | 
			
		||||
#endif /* READ_TRANSFORMS */
 | 
			
		||||
#endif /* READ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										32
									
								
								pngrutil.c
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								pngrutil.c
									
									
									
									
									
								
							@ -76,7 +76,7 @@ png_get_uint_16)(png_const_bytep buf)
 | 
			
		||||
{
 | 
			
		||||
   return PNG_U16(buf[0], buf[1]);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_INT_FUNCTIONS_SUPPORTED */
 | 
			
		||||
#endif /* READ_INT_FUNCTIONS */
 | 
			
		||||
 | 
			
		||||
/* This is an exported function however its error handling is too harsh for most
 | 
			
		||||
 * internal use.  For example if it were used for reading the chunk parameters
 | 
			
		||||
@ -304,7 +304,7 @@ png_read_buffer(png_structrp png_ptr, png_alloc_size_t new_size, int warn)
 | 
			
		||||
 | 
			
		||||
   return buffer;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_iCCP|iTXt|pCAL|sCAL|sPLT|tEXt|zTXt|SEQUENTIAL_READ */
 | 
			
		||||
#endif /* READ_iCCP|iTXt|pCAL|sCAL|sPLT|tEXt|zTXt|SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
/* png_inflate_claim: claim the zstream for some nefarious purpose that involves
 | 
			
		||||
 * decompression.  Returns Z_OK on success, else a zlib error code.  It checks
 | 
			
		||||
@ -701,7 +701,7 @@ png_decompress_chunk(png_structrp png_ptr,
 | 
			
		||||
      return Z_MEM_ERROR;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_COMPRESSED_TEXT_SUPPORTED */
 | 
			
		||||
#endif /* READ_COMPRESSED_TEXT */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_iCCP_SUPPORTED
 | 
			
		||||
/* Perform a partial read and decompress, producing 'avail_out' bytes and
 | 
			
		||||
@ -1278,7 +1278,7 @@ png_handle_sRGB(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 | 
			
		||||
   (void)png_colorspace_set_sRGB(png_ptr, &png_ptr->colorspace, intent);
 | 
			
		||||
   png_colorspace_sync(png_ptr, info_ptr);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_sRGB_SUPPORTED */
 | 
			
		||||
#endif /* READ_sRGB */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_iCCP_SUPPORTED
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
@ -1551,7 +1551,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 | 
			
		||||
   if (errmsg != NULL) /* else already output */
 | 
			
		||||
      png_chunk_benign_error(png_ptr, errmsg);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_iCCP_SUPPORTED */
 | 
			
		||||
#endif /* READ_iCCP */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_sPLT_SUPPORTED
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
@ -1729,7 +1729,7 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
 | 
			
		||||
 | 
			
		||||
   png_free(png_ptr, new_palette.entries);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_sPLT_SUPPORTED */
 | 
			
		||||
#endif /* READ_sPLT */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_tRNS_SUPPORTED
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
@ -2744,7 +2744,7 @@ png_cache_unknown_chunk(png_structrp png_ptr, png_uint_32 length)
 | 
			
		||||
      return 1;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */
 | 
			
		||||
#endif /* READ_UNKNOWN_CHUNKS */
 | 
			
		||||
 | 
			
		||||
/* Handle an unknown, or known but disabled, chunk */
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
@ -2925,7 +2925,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
 | 
			
		||||
   png_crc_finish(png_ptr, length);
 | 
			
		||||
   PNG_UNUSED(info_ptr)
 | 
			
		||||
   PNG_UNUSED(keep)
 | 
			
		||||
#endif /* !PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */
 | 
			
		||||
#endif /* !READ_UNKNOWN_CHUNKS */
 | 
			
		||||
 | 
			
		||||
   /* Check for unhandled critical chunks */
 | 
			
		||||
   if (!handled && PNG_CHUNK_CRITICAL(png_ptr->chunk_name))
 | 
			
		||||
@ -3162,7 +3162,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
 | 
			
		||||
          */
 | 
			
		||||
#        define MASK(pass,depth,display,png)\
 | 
			
		||||
            ((display)?B_MASK(pass,depth,png):S_MASK(pass,depth,png))
 | 
			
		||||
#endif /* !PNG_USE_COMPILE_TIME_MASKS */
 | 
			
		||||
#endif /* !USE_COMPILE_TIME_MASKS */
 | 
			
		||||
 | 
			
		||||
         /* Use the appropriate mask to copy the required bits.  In some cases
 | 
			
		||||
          * the byte mask will be 0 or 0xff; optimize these cases.  row_width is
 | 
			
		||||
@ -3413,7 +3413,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
 | 
			
		||||
                     return;
 | 
			
		||||
                  }
 | 
			
		||||
               }
 | 
			
		||||
#endif /* PNG_ALIGN_ code */
 | 
			
		||||
#endif /* ALIGN_ code */
 | 
			
		||||
 | 
			
		||||
               /* The true default - use a memcpy: */
 | 
			
		||||
               for (;;)
 | 
			
		||||
@ -3693,7 +3693,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
 | 
			
		||||
   PNG_UNUSED(transformations)  /* Silence compiler warning */
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
png_read_filter_row_sub(png_row_infop row_info, png_bytep row,
 | 
			
		||||
@ -4101,7 +4101,7 @@ png_read_finish_row(png_structrp png_ptr)
 | 
			
		||||
 | 
			
		||||
   /* Offset to next interlace block in the y direction */
 | 
			
		||||
   static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
 | 
			
		||||
   png_debug(1, "in png_read_finish_row");
 | 
			
		||||
   png_ptr->row_number++;
 | 
			
		||||
@ -4146,12 +4146,12 @@ png_read_finish_row(png_structrp png_ptr)
 | 
			
		||||
      if (png_ptr->pass < 7)
 | 
			
		||||
         return;
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
 | 
			
		||||
   /* Here after at the end of the last row of the last pass. */
 | 
			
		||||
   png_read_finish_IDAT(png_ptr);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
 | 
			
		||||
#endif /* SEQUENTIAL_READ */
 | 
			
		||||
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
png_read_start_row(png_structrp png_ptr)
 | 
			
		||||
@ -4197,7 +4197,7 @@ png_read_start_row(png_structrp png_ptr)
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   else
 | 
			
		||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
 | 
			
		||||
#endif /* READ_INTERLACING */
 | 
			
		||||
   {
 | 
			
		||||
      png_ptr->num_rows = png_ptr->height;
 | 
			
		||||
      png_ptr->iwidth = png_ptr->width;
 | 
			
		||||
@ -4447,4 +4447,4 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
 | 
			
		||||
 | 
			
		||||
   png_ptr->flags |= PNG_FLAG_ROW_INIT;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED */
 | 
			
		||||
#endif /* READ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								pngset.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								pngset.c
									
									
									
									
									
								
							@ -132,7 +132,7 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
 | 
			
		||||
}
 | 
			
		||||
#  endif /* PNG_FLOATING_POINT_SUPPORTED */
 | 
			
		||||
 | 
			
		||||
#endif /* PNG_cHRM_SUPPORTED */
 | 
			
		||||
#endif /* cHRM */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_gAMA_SUPPORTED
 | 
			
		||||
void PNGFAPI
 | 
			
		||||
@ -1110,7 +1110,7 @@ png_set_sPLT(png_structrp png_ptr,
 | 
			
		||||
   if (nentries > 0)
 | 
			
		||||
      png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_sPLT_SUPPORTED */
 | 
			
		||||
#endif /* sPLT */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
 | 
			
		||||
static png_byte
 | 
			
		||||
@ -1606,7 +1606,7 @@ png_set_chunk_malloc_max (png_structrp png_ptr,
 | 
			
		||||
   if (png_ptr != NULL)
 | 
			
		||||
      png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
 | 
			
		||||
}
 | 
			
		||||
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
 | 
			
		||||
#endif /* ?SET_USER_LIMITS */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
 | 
			
		||||
@ -1629,7 +1629,7 @@ png_set_benign_errors(png_structrp png_ptr, int allowed)
 | 
			
		||||
      png_ptr->flags &= ~(PNG_FLAG_BENIGN_ERRORS_WARN |
 | 
			
		||||
         PNG_FLAG_APP_WARNINGS_WARN | PNG_FLAG_APP_ERRORS_WARN);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_BENIGN_ERRORS_SUPPORTED */
 | 
			
		||||
#endif /* BENIGN_ERRORS */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
 | 
			
		||||
   /* Whether to report invalid palette index; added at libng-1.5.10.
 | 
			
		||||
@ -1652,4 +1652,4 @@ png_set_check_for_invalid_index(png_structrp png_ptr, int allowed)
 | 
			
		||||
      png_ptr->num_palette_max = -1;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* READ || WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								pngtest.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								pngtest.c
									
									
									
									
									
								
							@ -311,7 +311,7 @@ count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
 | 
			
		||||
       }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_USER_TRANSFORM_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_USER_TRANSFORM */
 | 
			
		||||
 | 
			
		||||
#ifndef PNG_STDIO_SUPPORTED
 | 
			
		||||
/* START of code to validate stdio-free compilation */
 | 
			
		||||
@ -420,7 +420,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
 | 
			
		||||
   pngtest_check_io_state(png_ptr, length, PNG_IO_WRITING);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif /* !PNG_STDIO_SUPPORTED */
 | 
			
		||||
#endif /* !STDIO */
 | 
			
		||||
 | 
			
		||||
/* This function is called when there is a warning, but the library thinks
 | 
			
		||||
 * it can continue anyway.  Replacement functions don't have to do anything
 | 
			
		||||
@ -605,7 +605,7 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
 | 
			
		||||
      free(ptr);
 | 
			
		||||
   ptr = NULL;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_USER_MEM_SUPPORTED && PNG_DEBUG */
 | 
			
		||||
#endif /* USER_MEM && DEBUG */
 | 
			
		||||
/* END of code to test memory allocation/deallocation */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -780,7 +780,7 @@ write_chunks(png_structp write_ptr, int location)
 | 
			
		||||
         write_vpAg_chunk(write_ptr);
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* WRITE */
 | 
			
		||||
#else /* !PNG_READ_USER_CHUNKS_SUPPORTED */
 | 
			
		||||
#  define write_chunks(pp,loc) ((void)0)
 | 
			
		||||
#endif
 | 
			
		||||
@ -1290,7 +1290,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         tIME_chunk_present++;
 | 
			
		||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */
 | 
			
		||||
#endif /* TIME_RFC1123 */
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
@ -1406,7 +1406,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
 | 
			
		||||
         t_encode += (t_stop - t_start);
 | 
			
		||||
         t_start = t_stop;
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* WRITE */
 | 
			
		||||
 | 
			
		||||
#ifndef SINGLE_ROWBUF_ALLOC
 | 
			
		||||
         pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y);
 | 
			
		||||
@ -1473,7 +1473,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         tIME_chunk_present++;
 | 
			
		||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */
 | 
			
		||||
#endif /* TIME_RFC1123 */
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
@ -1678,7 +1678,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* WRITE */
 | 
			
		||||
 | 
			
		||||
   FCLOSE(fpin);
 | 
			
		||||
   FCLOSE(fpout);
 | 
			
		||||
@ -1835,7 +1835,7 @@ main(int argc, char *argv[])
 | 
			
		||||
            fprintf(STDERR, " tIME = %s\n", tIME_string);
 | 
			
		||||
 | 
			
		||||
         tIME_chunk_present = 0;
 | 
			
		||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */
 | 
			
		||||
#endif /* TIME_RFC1123 */
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
         else
 | 
			
		||||
@ -1924,7 +1924,7 @@ main(int argc, char *argv[])
 | 
			
		||||
#ifdef PNG_TIME_RFC1123_SUPPORTED
 | 
			
		||||
             if (tIME_chunk_present != 0)
 | 
			
		||||
                fprintf(STDERR, " tIME = %s\n", tIME_string);
 | 
			
		||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */
 | 
			
		||||
#endif /* TIME_RFC1123 */
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								pngtrans.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								pngtrans.c
									
									
									
									
									
								
							@ -478,7 +478,7 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
 | 
			
		||||
         *rp = table[*rp];
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_PACKSWAP_SUPPORTED or PNG_WRITE_PACKSWAP_SUPPORTED */
 | 
			
		||||
#endif /* READ_PACKSWAP or WRITE_PACKSWAP */
 | 
			
		||||
 | 
			
		||||
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
 | 
			
		||||
    defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
 | 
			
		||||
@ -675,7 +675,7 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
 | 
			
		||||
#endif
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */
 | 
			
		||||
#endif /* READ_BGR or WRITE_BGR */
 | 
			
		||||
 | 
			
		||||
#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \
 | 
			
		||||
    defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED)
 | 
			
		||||
@ -778,7 +778,7 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED */
 | 
			
		||||
#endif /* CHECK_FOR_INVALID_INDEX */
 | 
			
		||||
 | 
			
		||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
 | 
			
		||||
    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
 | 
			
		||||
@ -844,7 +844,7 @@ png_get_current_pass_number(png_const_structrp png_ptr)
 | 
			
		||||
      return png_ptr->pass;
 | 
			
		||||
   return 8; /* invalid */
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_USER_TRANSFORM_INFO_SUPPORTED */
 | 
			
		||||
#endif /* PNG_READ_USER_TRANSFORM_SUPPORTED ||
 | 
			
		||||
#endif /* USER_TRANSFORM_INFO */
 | 
			
		||||
#endif /* READ_USER_TRANSFORM ||
 | 
			
		||||
          PNG_WRITE_USER_TRANSFORM_SUPPORTED */
 | 
			
		||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* READ || WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								pngwio.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								pngwio.c
									
									
									
									
									
								
							@ -151,7 +151,7 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
 | 
			
		||||
#  endif
 | 
			
		||||
#else
 | 
			
		||||
   PNG_UNUSED(output_flush_fn)
 | 
			
		||||
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_FLUSH */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_READ_SUPPORTED
 | 
			
		||||
   /* It is an error to read while writing a png file */
 | 
			
		||||
@ -165,4 +165,4 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								pngwrite.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								pngwrite.c
									
									
									
									
									
								
							@ -69,7 +69,7 @@ write_unknown_chunks(png_structrp png_ptr, png_const_inforp info_ptr,
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_UNKNOWN_CHUNKS */
 | 
			
		||||
 | 
			
		||||
/* Writes all the PNG information.  This is the suggested way to use the
 | 
			
		||||
 * library.  If you have a new chunk to add, make a function to write it,
 | 
			
		||||
@ -501,7 +501,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
 | 
			
		||||
{
 | 
			
		||||
   png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
 | 
			
		||||
      error_fn, warn_fn, mem_ptr, malloc_fn, free_fn);
 | 
			
		||||
#endif /* PNG_USER_MEM_SUPPORTED */
 | 
			
		||||
#endif /* USER_MEM */
 | 
			
		||||
 | 
			
		||||
   if (png_ptr != NULL)
 | 
			
		||||
   {
 | 
			
		||||
@ -526,7 +526,7 @@ png_create_write_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr,
 | 
			
		||||
      png_ptr->zlib_text_mem_level = 8;
 | 
			
		||||
      png_ptr->zlib_text_window_bits = 15;
 | 
			
		||||
      png_ptr->zlib_text_method = 8;
 | 
			
		||||
#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_COMPRESSED_TEXT */
 | 
			
		||||
 | 
			
		||||
      /* This is a highly dubious configuration option; by default it is off,
 | 
			
		||||
       * but it may be appropriate for private builds that are testing
 | 
			
		||||
@ -676,10 +676,10 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
 | 
			
		||||
            *(rp + 5) = (png_byte)(blue & 0xff);
 | 
			
		||||
         }
 | 
			
		||||
      }
 | 
			
		||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_16BIT */
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */
 | 
			
		||||
#endif /* MNG_FEATURES */
 | 
			
		||||
 | 
			
		||||
/* Called by user to write a row of image data */
 | 
			
		||||
void PNGAPI
 | 
			
		||||
@ -920,7 +920,7 @@ png_write_flush(png_structrp png_ptr)
 | 
			
		||||
   png_ptr->flush_rows = 0;
 | 
			
		||||
   png_flush(png_ptr);
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_FLUSH */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
 | 
			
		||||
static void png_reset_filter_heuristics(png_structrp png_ptr);/* forward decl */
 | 
			
		||||
@ -1352,7 +1352,7 @@ png_set_filter_heuristics_fixed(png_structrp png_ptr, int heuristic_method,
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* FIXED_POINT */
 | 
			
		||||
#endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_WEIGHTED_FILTER */
 | 
			
		||||
 | 
			
		||||
void PNGAPI
 | 
			
		||||
png_set_compression_level(png_structrp png_ptr, int level)
 | 
			
		||||
@ -1509,7 +1509,7 @@ png_set_text_compression_method(png_structrp png_ptr, int method)
 | 
			
		||||
 | 
			
		||||
   png_ptr->zlib_text_method = method;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
 | 
			
		||||
/* end of API added to libpng-1.5.4 */
 | 
			
		||||
 | 
			
		||||
void PNGAPI
 | 
			
		||||
@ -2430,6 +2430,6 @@ png_image_write_to_file(png_imagep image, const char *file_name,
 | 
			
		||||
   else
 | 
			
		||||
      return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_STDIO_SUPPORTED */
 | 
			
		||||
#endif /* STDIO */
 | 
			
		||||
#endif /* SIMPLIFIED_WRITE */
 | 
			
		||||
#endif /* PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										12
									
								
								pngwtran.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								pngwtran.c
									
									
									
									
									
								
							@ -353,7 +353,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
 | 
			
		||||
               *(dp++) = save[1];
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_16BIT */
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
 | 
			
		||||
@ -392,7 +392,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
 | 
			
		||||
               *(dp++) = save[1];
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_16BIT */
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
@ -449,7 +449,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
 | 
			
		||||
               *(dp++) = (png_byte)(255 - *(sp++));
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_16BIT */
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
 | 
			
		||||
@ -487,7 +487,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
 | 
			
		||||
               *(dp++) = (png_byte)(255 - *(sp++));
 | 
			
		||||
            }
 | 
			
		||||
         }
 | 
			
		||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_16BIT */
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
@ -570,5 +570,5 @@ png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
 | 
			
		||||
      png_do_invert(row_info, png_ptr->row_buf + 1);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
 | 
			
		||||
#endif /* PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_TRANSFORMS */
 | 
			
		||||
#endif /* WRITE */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								pngwutil.c
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								pngwutil.c
									
									
									
									
									
								
							@ -286,7 +286,7 @@ optimize_cmf(png_bytep data, png_alloc_size_t data_size)
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_OPTIMIZE_CMF_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_OPTIMIZE_CMF */
 | 
			
		||||
 | 
			
		||||
/* Initialize the compressor for the appropriate type of compression. */
 | 
			
		||||
static int
 | 
			
		||||
@ -663,7 +663,7 @@ png_write_compressed_data_out(png_structrp png_ptr, compression_state *comp)
 | 
			
		||||
   if (output_len > 0)
 | 
			
		||||
      png_error(png_ptr, "error writing ancillary chunked compressed data");
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_COMPRESSED_TEXT */
 | 
			
		||||
 | 
			
		||||
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
 | 
			
		||||
    defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
 | 
			
		||||
@ -743,7 +743,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
 | 
			
		||||
 | 
			
		||||
      png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'");
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_WARNINGS_SUPPORTED */
 | 
			
		||||
#endif /* WARNINGS */
 | 
			
		||||
 | 
			
		||||
   return key_len;
 | 
			
		||||
}
 | 
			
		||||
@ -1979,7 +1979,7 @@ png_write_alloc_filter_row_buffers(png_structrp png_ptr, int filters)
 | 
			
		||||
      png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
 | 
			
		||||
   }
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_FILTER */
 | 
			
		||||
 | 
			
		||||
/* Initializes the row writing capability of libpng */
 | 
			
		||||
void /* PRIVATE */
 | 
			
		||||
@ -2049,7 +2049,7 @@ png_write_start_row(png_structrp png_ptr)
 | 
			
		||||
   png_ptr->do_filter = (png_byte)filters; /* in case it was changed above */
 | 
			
		||||
#else
 | 
			
		||||
   png_ptr->do_filter = PNG_FILTER_NONE;
 | 
			
		||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_FILTER */
 | 
			
		||||
 | 
			
		||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
 | 
			
		||||
   /* If interlaced, we need to set up width and height of pass */
 | 
			
		||||
@ -2952,7 +2952,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
 | 
			
		||||
 | 
			
		||||
         else
 | 
			
		||||
            p = c;
 | 
			
		||||
#endif /* PNG_SLOW_PAETH */
 | 
			
		||||
#endif /* SLOW_PAETH */
 | 
			
		||||
 | 
			
		||||
         v = *dp++ = (png_byte)(((int)*rp++ - p) & 0xff);
 | 
			
		||||
 | 
			
		||||
@ -3001,7 +3001,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
 | 
			
		||||
         best_row = png_ptr->paeth_row;
 | 
			
		||||
      }
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_FILTER */
 | 
			
		||||
 | 
			
		||||
   /* Do the actual writing of the filtered row data from the chosen filter. */
 | 
			
		||||
   png_write_filtered_row(png_ptr, best_row, row_info->rowbytes+1);
 | 
			
		||||
@ -3021,7 +3021,7 @@ png_write_find_filter(png_structrp png_ptr, png_row_infop row_info)
 | 
			
		||||
      png_ptr->prev_filters[j] = best_row[0];
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_FILTER */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -3046,7 +3046,7 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
 | 
			
		||||
      png_ptr->prev_row = png_ptr->row_buf;
 | 
			
		||||
      png_ptr->row_buf = tptr;
 | 
			
		||||
   }
 | 
			
		||||
#endif /* PNG_WRITE_FILTER_SUPPORTED */
 | 
			
		||||
#endif /* WRITE_FILTER */
 | 
			
		||||
 | 
			
		||||
   /* Finish row - updates counters and flushes zlib if last row */
 | 
			
		||||
   png_write_finish_row(png_ptr);
 | 
			
		||||
@ -3061,4 +3061,4 @@ png_write_filtered_row(png_structrp png_ptr, png_bytep filtered_row,
 | 
			
		||||
   }
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
#endif /* PNG_WRITE_SUPPORTED */
 | 
			
		||||
#endif /* WRITE */
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user