summaryrefslogtreecommitdiff
path: root/pngwutil.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-07-31 14:20:40 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-07-31 14:21:46 -0500
commit40afb685704f1a5bf8d9edc0b5c7ec7f25e94b77 (patch)
treefd230ed1d47cdb8bde8055284494bda7f8256484 /pngwutil.c
parent4ab78af90a0f54665a8c1aca16745d2f641c7efb (diff)
[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().
Diffstat (limited to 'pngwutil.c')
-rw-r--r--pngwutil.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/pngwutil.c b/pngwutil.c
index 348bb524d..d0884175a 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1479,24 +1479,15 @@ void /* PRIVATE */
png_write_eXIf(png_structrp png_ptr, png_bytep exif, int num_exif)
{
int i;
- png_byte buf[3];
+ png_byte buf[1];
png_debug(1, "in png_write_eXIf");
- if (num_exif > (int)png_ptr->num_exif)
- {
- png_debug2(3, "num_exif = %d, png_ptr->num_exif = %d", num_exif,
- png_ptr->num_exif);
-
- png_warning(png_ptr, "Invalid number of exif bytes specified");
- return;
- }
-
png_write_chunk_header(png_ptr, png_eXIf, (png_uint_32)(num_exif));
for (i = 0; i < num_exif; i++)
{
- buf[i] = exif[i];
+ buf[0] = exif[i];
png_write_chunk_data(png_ptr, buf, (png_size_t)1);
}