[libpng16] Restored png_get_eXIf_1() and png_set_eXIf_1() because strlen(eXIf_buf)

does not work (the eXIf chunk data can contain zeroes).
This commit is contained in:
Glenn Randers-Pehrson
2017-08-03 10:29:10 -05:00
parent a1fe2c9848
commit d930d36155
7 changed files with 39 additions and 13 deletions

View File

@@ -138,6 +138,15 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
void PNGAPI
png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
const png_bytep eXIf_buf)
{
png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1");
PNG_UNUSED(info_ptr)
PNG_UNUSED(eXIf_buf)
}
void PNGAPI
png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
const png_uint_32 num_exif, const png_bytep eXIf_buf)
{
int i;
@@ -152,7 +161,7 @@ png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
info_ptr->exif = NULL;
}
info_ptr->num_exif = (png_uint_32)strlen((const char *)eXIf_buf);
info_ptr->num_exif = num_exif;
info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
info_ptr->num_exif));