[freeimage] 43/47: Use system libtiff (Closes: #735249) Thanks to Sabayon from Gentoo for the hints; Cherry pick upstream fix for truncation of tags in TIFF files Thanks to Julian Taylor (Closes: #735847)

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Sat Sep 26 22:27:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository freeimage.

commit 6735a73e64d8ce6439a070c0f0b47d78c95dc79a
Author: Scott Howard <showard314 at gmail.com>
Date:   Mon Jan 20 16:44:13 2014 -0500

    Use system libtiff (Closes: #735249) Thanks to Sabayon from Gentoo for the hints; Cherry pick upstream fix for truncation of tags in TIFF files Thanks to Julian Taylor (Closes: #735847)
---
 debian/changelog                    |  9 ++++++---
 debian/patches/series               |  1 +
 debian/patches/tag_truncation.patch | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 8e6d692..a134c58 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,12 @@
-freeimage (3.15.4-3) UNRELEASED; urgency=low
+freeimage (3.15.4-3) unstable; urgency=low
 
   * QA upload.
   * disable_embedded_libraries.patch
-    - Remove embedded libtiff (Closes: #735847, #735249)
-      Thanks to Sabayon from Gentoo for the tip
+    - Use system libtiff (Closes: #735249)
+      Thanks to Sabayon from Gentoo for the hints
+  * tag_truncation.patch
+    - Cherry pick upstream fix for truncation of tags in TIFF files
+      Thanks to Julian Taylor (Closes: #735847)
 
  -- Scott Howard <showard at debian.org>  Sun, 19 Jan 2014 21:44:52 -0500
 
diff --git a/debian/patches/series b/debian/patches/series
index c08a501..46bcb26 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 disable_embedded_libraries.patch
 fix_ftbfs_amd64.patch
 makefile_modifications.patch
+tag_truncation.patch
diff --git a/debian/patches/tag_truncation.patch b/debian/patches/tag_truncation.patch
new file mode 100644
index 0000000..6c9ee8c
--- /dev/null
+++ b/debian/patches/tag_truncation.patch
@@ -0,0 +1,33 @@
+Description: fixes tag truncation bug in TIFF files
+Origin: http://sourceforge.net/p/freeimage/discussion/36110/thread/3738788c/
+http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/Metadata/XTIFF.cpp?r1=1.23&r2=1.24&view=patch
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735847
+
+Index: freeimage/Source/Metadata/XTIFF.cpp
+===================================================================
+--- freeimage.orig/Source/Metadata/XTIFF.cpp	2014-01-20 13:15:11.093762169 -0500
++++ freeimage/Source/Metadata/XTIFF.cpp	2014-01-20 13:15:11.085766168 -0500
+@@ -451,10 +451,20 @@
+ 			FreeImage_SetTagValue(fitag, raw_data);
+ 			break;
+ 
++                case TIFF_ASCII:
+ 		default: {
+-			// remember that raw_data = _TIFFmalloc(value_size * value_count);
+-			const int value_size = _TIFFDataSize(fip->field_type);
+-			size_t length = value_size * value_count;
++                        size_t length = 0;
++                        if(!mem_alloc && (fip->field_type == TIFF_ASCII) && (fip->field_readcount == TIFF_VARIABLE)) {
++                                // when metadata tag is of type ASCII and it's value is of variable size (TIFF_VARIABLE),
++                                // tiff_read_exif_tag function gives length of 1 so all strings are truncated ...
++                                // ... try to avoid this by using an explicit calculation for 'length'
++                                length = strlen((char*)raw_data) + 1;
++                        }
++                        else {
++                                // remember that raw_data = _TIFFmalloc(value_size * value_count);
++                                const int value_size = _TIFFDataSize(fip->field_type);
++                                length = value_size * value_count;
++                        }
+ 			FreeImage_SetTagType(fitag, FIDT_ASCII);
+ 			FreeImage_SetTagLength(fitag, (DWORD)length);
+ 			FreeImage_SetTagCount(fitag, (DWORD)length);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/freeimage.git



More information about the debian-science-commits mailing list