[libpng16] Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf()
in pngwrite.c, and made various other fixes to png_write_eXIf().
Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
to arguments for png_get_eXIf() and png_set_eXIf().
diff --git a/pngset.c b/pngset.c
index 9984735..a6a2206 100644
--- a/pngset.c
+++ b/pngset.c
@@ -137,7 +137,7 @@
#ifdef PNG_eXIf_SUPPORTED
void PNGAPI
png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
- const png_bytep eXIf_buf)
+ const png_uint_32 num_exif, const png_bytep eXIf_buf)
{
int i;
@@ -148,6 +148,8 @@
png_free_data(png_ptr, info_ptr, PNG_FREE_EXIF, 0);
+ info_ptr->num_exif = num_exif;
+
info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
info_ptr->num_exif));
@@ -160,7 +162,7 @@
info_ptr->free_me |= PNG_FREE_EXIF;
- for (i = 0; i < info_ptr->num_exif; i++)
+ for (i = 0; i < (int) num_exif; i++)
info_ptr->exif[i] = eXIf_buf[i];
info_ptr->valid |= PNG_INFO_eXIf;