From: Cristy Date: Sat, 25 Nov 2017 22:55:43 +0000 (-0500) Subject: PNG, accept EXIF without magic header X-Git-Tag: 7.0.7-12~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56596b797ec27544a4a5095f726e0f35b94bf2bc;p=imagemagick PNG, accept EXIF without magic header --- diff --git a/coders/png.c b/coders/png.c index 1089ff001..68aa0a934 100644 --- a/coders/png.c +++ b/coders/png.c @@ -11744,15 +11744,20 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, break; /* otherwise crashes */ } - /* skip the "Exif\0\0" JFIF Exif Header ID */ - length -= 6; + if (*data == 'E' && *(data+1) == 'x' && *(data+2) == 'i' && + *(data+3) == 'f' && *(data+4) == '\0' && *(data+5) == '\0') + { + /* skip the "Exif\0\0" JFIF Exif Header ID */ + length -= 6; + data += 6; + } LogPNGChunk(logging,chunk,length); (void) WriteBlobMSBULong(image,length); (void) WriteBlob(image,4,chunk); - (void) WriteBlob(image,length,data+6); - (void) WriteBlobMSBULong(image,crc32(crc32(0,chunk,4), - data+6, (uInt) length)); + (void) WriteBlob(image,length,data); + (void) WriteBlobMSBULong(image,crc32(crc32(0,chunk,4), data, + (uInt) length)); ping_profile=DestroyStringInfo(ping_profile); break; } diff --git a/configure b/configure index 0767330cf..c1794fd1f 100755 --- a/configure +++ b/configure @@ -4559,7 +4559,7 @@ MAGICK_PATCHLEVEL_VERSION=12 MAGICK_VERSION=7.0.7-12 -MAGICK_GIT_REVISION=21775:a886ad39e:20171124 +MAGICK_GIT_REVISION=21786:0ee44fcdb:20171125 # Substitute library versioning