summaryrefslogtreecommitdiff
path: root/media-gfx/exiv2/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-12-31 13:43:35 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-12-31 13:43:35 +0000
commit2891d29af8907ce881662f4a02844926d7a293c7 (patch)
tree56979d96839d0827aa52008b81b746b4934d88df /media-gfx/exiv2/files
parentde49812990871e1705b64051c35161d5e6400269 (diff)
gentoo resync : 31.12.2018
Diffstat (limited to 'media-gfx/exiv2/files')
-rw-r--r--media-gfx/exiv2/files/exiv2-0.27.0-png-broken-icc-profile.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/media-gfx/exiv2/files/exiv2-0.27.0-png-broken-icc-profile.patch b/media-gfx/exiv2/files/exiv2-0.27.0-png-broken-icc-profile.patch
new file mode 100644
index 000000000000..ae0a0ee30dce
--- /dev/null
+++ b/media-gfx/exiv2/files/exiv2-0.27.0-png-broken-icc-profile.patch
@@ -0,0 +1,34 @@
+diff --git a/src/pngimage.cpp b/src/pngimage.cpp
+index 90844d09..b5b0cd24 100644
+--- a/src/pngimage.cpp
++++ b/src/pngimage.cpp
+@@ -501,7 +501,20 @@ namespace Exiv2 {
+ }
+ else if (!memcmp(cheaderBuf.pData_ + 4, "iCCP", 4))
+ {
+- zlibToDataBuf(cdataBuf.pData_ +12+1,dataOffset-13,iccProfile_); // +1 = 'compressed' flag
++ // The ICC profile name can vary from 1-79 characters.
++ uint32_t iccOffset = 0;
++ while (iccOffset < 80 && iccOffset < dataOffset) {
++
++ const byte* profileName = cdataBuf.pData_ + iccOffset;
++ ++iccOffset;
++
++ if (*profileName == 0x00)
++ break;
++ }
++
++ ++iccOffset; // +1 = 'compressed' flag
++
++ zlibToDataBuf(cdataBuf.pData_ +iccOffset,dataOffset-iccOffset,iccProfile_);
+ #ifdef DEBUG
+ std::cout << "Exiv2::PngImage::readMetadata: Found iCCP chunk length: " << dataOffset << std::endl;
+ std::cout << "Exiv2::PngImage::readMetadata: iccProfile.size_ : " << iccProfile_.size_ << std::endl;
+@@ -662,6 +675,7 @@ namespace Exiv2 {
+
+ // calculate CRC
+ uLong tmp = crc32(0L, Z_NULL, 0);
++ tmp = crc32(tmp, (const Bytef*)type ,typeLen);
+ tmp = crc32(tmp, (const Bytef*)header ,headerLen);
+ tmp = crc32(tmp, (const Bytef*)compressed.pData_,compressed.size_);
+ byte crc[4];