summaryrefslogtreecommitdiff
path: root/media-libs/tiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/tiff')
-rw-r--r--media-libs/tiff/Manifest6
-rw-r--r--media-libs/tiff/files/tiff-4.7.0-fix-test-race.patch30
-rw-r--r--media-libs/tiff/files/tiff-4.7.0-test-directory-big-endian.patch328
-rw-r--r--media-libs/tiff/tiff-4.7.0-r1.ebuild7
-rw-r--r--media-libs/tiff/tiff-4.7.0.ebuild4
5 files changed, 371 insertions, 4 deletions
diff --git a/media-libs/tiff/Manifest b/media-libs/tiff/Manifest
index d93a3d4ae1a1..87dd6604f381 100644
--- a/media-libs/tiff/Manifest
+++ b/media-libs/tiff/Manifest
@@ -2,6 +2,8 @@ AUX tiff-4.5.0-CVE-2022-48281.patch 496 BLAKE2B 08d90ff28e2e4338db3aa65b6fc0ee2e
AUX tiff-4.5.0-CVE-2023-0795-CVE-2023-0796-CVE-2023-0797-CVE-2023-0798-CVE-2023-0799.patch 13741 BLAKE2B 0e95d28944143fd3dd315dd8f6dca16baf9819cd920802feae5bdba791976f758a890364e9d3b4dc5387220090589406135b6692f1e4b0a4a92c2ef6d7a5c17f SHA512 a3ee53a95b64989a2d2917c94b0fb9923f3308b9b670d712296733eeb06240231b3e419f70438f717199eb7c3e406ae0c1872f25767d7635a846b916e067b5ee
AUX tiff-4.5.0-CVE-2023-0800-CVE-2023-0801-CVE-2023-0802-CVE-2023-0803-CVE-2023-0804.patch 5925 BLAKE2B 82e499f28330cbf00f01b495485fc689e6f7eed26b2b16505857fb23c58ad62fee7020c48fc07d1e44b747ca8c7286e7f927b2c1a5520c79ba61d3029d28001f SHA512 097631e05e40f573880fe79623fbd3292641ee9f3431ef2fdb7285e3b8583e6e0d0a1bfff36dc1901ad6e4c34dff97da59904797f8f71ed4b965b2ae258daaa6
AUX tiff-4.5.0_rc1-skip-tools-tests-multilib.patch 1477 BLAKE2B d6daf36a65fcd2afbec2fd5e5f3b75fa4547f32079c0709e98a48b0ba28d993346dfc597ef46b37db5242f2e28c7dd87a1616fe9324ca2d9659a97040bcd23db SHA512 0c7b69ddd772d73fde800e610ed533804392d0ea4ddefa409f52abcf174cc77cd1f4160a03076043d654533e98812d642d5166030d97b273ec80f5288bf3eda3
+AUX tiff-4.7.0-fix-test-race.patch 1108 BLAKE2B 2a974a70fca5acd51f888429cc44ebc1e6104364720826cbede6763bdf22fc250a08b2348fc108dfc81ea54826ada3e8c45ace09572ff128638f1663da49aa8c SHA512 741c5d5394e8ecca09130d2884f4f883785c0d3aca9915cc746587a784105be0f97474ce620f5018297f7dd2644d10b9870c93161ddf3af3fe3325b60538892a
+AUX tiff-4.7.0-test-directory-big-endian.patch 14212 BLAKE2B d9be5513727114824b8bcbc2b5e42a57d71093996162742cda5dfe34fb051583f6b9451abb3b85a73c134f19b3a64b9ce820182cebf4d4e9129f9e1d20f47941 SHA512 375c912da1d86173fa9d60ff9486a05313ed9dc94ddb1200c4b0d85d67b4375644e05c3a8e679008e7572efbeaf10f7488d55d5d868629ca584db38f0d31438a
DIST tiff-4.5.0.tar.xz 2320900 BLAKE2B c69801ba9d55b1ed27a92d31d8cd16937fe69299fbf5450efb4a6caa60245b72ddade110daae78f2198613640383623f76ec2265ba785375d0a85c7909b73fe9 SHA512 c6c866064c2dd5d1711c6ece7bafe5f011f5ce26c0aeaecbff79c05b5671f44150324bea95a0665cc43331883114de855ee1cd87ed733bff0f4d0814515b9f10
DIST tiff-4.5.0.tar.xz.sig 310 BLAKE2B bbe7f9600061416227276424eb220714a1375d3e295cb0c5b7f76074324c1a2698a5029dde3e734331e9caf02d8a086273ded2ab09285857dbbfe3ad83506912 SHA512 8cef09755f4efe68db69591967e495852cf63c2d8113a877a2254f536d38c60b6dc864c07089249cd8109a8408672a297ae9e59d8233687bc2796dc158ccfb32
DIST tiff-4.5.1.tar.xz 2228040 BLAKE2B 793c03593c46d6f804f622f5ff7e799751ee79e87ec1575801d2238fbcd2e89ed657a5081d3651e337f1bb14603ff94a15aad878e7fdf2cf75ada38eed64d9d2 SHA512 fc6af93d36598527480c517ddc4f19fe72e9f07ef4997e5731604253c8db0b9bae816ba7a56985bf22fbbb48db1fab5ed4c2b32a5145bc9477ef24b221a61179
@@ -14,6 +16,6 @@ EBUILD tiff-4.5.0-r2.ebuild 2858 BLAKE2B 3b1fb10b0b37f4a7ea7a19e9c7efa97ca736c7f
EBUILD tiff-4.5.1.ebuild 2475 BLAKE2B ef048936037c7e6d152d463441c17e2c4a226076f22a90c031777eb3f08e1593e1a7c1a559907f8f40b7669b24547ec9cbe09f4e1286aceaa34ae1dcb80f75d7 SHA512 2a1f0f1998a41b825bdb2d5076b59b6ec4830e35d0973a7a272f53642ce29ea7f6c76d3b65af1db00d18fa9f2d3dead14bf82bd6c0b303c7288130aea8519438
EBUILD tiff-4.6.0-r1.ebuild 2459 BLAKE2B 1747a8a7d4587ad7fb98859eb194d4773b1363bfd05e214174aec71b9ad2dede65c0ef5b1a41e72dc28878dad2f68745c85cce3266e245680cc62d39c070ff13 SHA512 0f3066293cb56d4bf87704f20dda0c6f6dae6f30dd78a3386704a872908579fe743309e6bf7b0c79f04dafa24a7bb73f3eaa9c2e92f1774007a125c0210f5598
EBUILD tiff-4.6.0.ebuild 2422 BLAKE2B acff03408569324c3f48c18284e03b183e77b2c31bad2056a2ab72254ad9afe358331fd59aaa922bf96e14fe028df1b6dbbbbc50971ea5bd50100beacb3ff495 SHA512 e8ee04b2333164669167d81e38993bfbf7dfd76e7b0456dbd08b8ed84a5115bc2eb2a748022c83c97325b5932839e901f4851bb995e194b85daeaa4063187dee
-EBUILD tiff-4.7.0-r1.ebuild 2703 BLAKE2B e57beadb3e5cea57cb129ce5c7b7ed69d5952e7c4b66d59a10ddadacb8f246563d28690f2d11a58a0772702f8467f9239136714c6bb3d0525f81a799a96bd284 SHA512 c74eef4e38222d0454cf7dcc7ca8c130648f6b82e2f8441518721fe4bff5f136308786a0a61a50c51810bc5e537241bcae20e33fd199c6e9b48cbabe3e749485
-EBUILD tiff-4.7.0.ebuild 2546 BLAKE2B e887bc36de86276a6da1250ba9fb47c98ae0a5a3c9019188673930dd62ee047bfa99d0a66da8272f65228a776cfc7aec9e82e7adf951e28bf4c6f35a010e7dde SHA512 9cbe3015a6d90b069cd240474ac22fa31dff392dac6e4fdeea4e5d2d788da676731ff5600a6715336bc454de6031635f8755255d541618a3fcf1414b4f6fa392
+EBUILD tiff-4.7.0-r1.ebuild 2820 BLAKE2B 83076f704afe27b3cab95a786b12993df64a3372562fd23fa463469b3c3b0a04be6a7c7d9f66dad294d304d7af995e87b06ffeb0b10e8d16159cbea3373adf04 SHA512 6a7c372421cf1f30f8da3147a752838ae38018cb82752fe249d900d12609f70da3196d78f9f76080ea6f5de16efdce672b2026c46dda73b6dbb4a4b477d8f315
+EBUILD tiff-4.7.0.ebuild 2611 BLAKE2B d31958355f25260f13671a1ec0efb5ca966d9ebe80c2df7392e78822d186bca95af649cf3ad718db80e9b3380d658f39bee68f259c548e217fce36d088606af1 SHA512 3a3d4963e884dcc0629bd22e81bee44d74b562a1a5744a381198b6623289e97ba921095f010816c4f84c3a13edb0da9bcd7810a683838fc0070a88ae681e6e93
MISC metadata.xml 722 BLAKE2B 0d24bf901d5d89dfa15aff1ae88c5b55defe7e596cc214fa89404b9012ea4e7a0f722e4c7095e5fe1c57d7d18921daf21125853ebc66c34a531f057b96e8a8a5 SHA512 b68eddf4baed5d883038605a8493721bf80ff6a85075e45cc74e972937e88a18aabb6a7e2c661d457bf21a628fa3447bb71ae2da0481c76bc84cf95ee58ae615
diff --git a/media-libs/tiff/files/tiff-4.7.0-fix-test-race.patch b/media-libs/tiff/files/tiff-4.7.0-fix-test-race.patch
new file mode 100644
index 000000000000..3c26eb617b1b
--- /dev/null
+++ b/media-libs/tiff/files/tiff-4.7.0-fix-test-race.patch
@@ -0,0 +1,30 @@
+https://gitlab.com/libtiff/libtiff/-/merge_requests/701
+https://bugs.gentoo.org/943020
+
+From efadbbd8746d2c6c8129438716e2c1e8aeecafdb Mon Sep 17 00:00:00 2001
+From: Gabi Falk <gabifalk@gmx.com>
+Date: Wed, 26 Feb 2025 14:00:00 +0000
+Subject: [PATCH] test: Fix race condition in
+ {tiffcrop,tiffcp}-32bpp-None-jpeg.sh tests
+
+These tests used the same output path, which could cause failures
+when run in parallel. These were the only tests with a conflicting
+outfile= parameter.
+
+Link: https://bugs.gentoo.org/943020
+---
+ test/tiffcrop-32bpp-None-jpeg.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/tiffcrop-32bpp-None-jpeg.sh b/test/tiffcrop-32bpp-None-jpeg.sh
+index 9b0d1f5f..4a47f6ed 100755
+--- a/test/tiffcrop-32bpp-None-jpeg.sh
++++ b/test/tiffcrop-32bpp-None-jpeg.sh
+@@ -2,6 +2,6 @@
+ # Generated file, master is Makefile.am
+ . ${srcdir:-.}/common.sh
+ infile="$srcdir/images/32bpp-None-jpeg.tiff"
+-outfile="o-tiffcp-32bpp-None-jpeg-YCbCr.tiff"
++outfile="o-tiffcrop-32bpp-None-jpeg-YCbCr.tiff"
+ f_test_convert "${TIFFCROP} -c jpeg" $infile $outfile
+ f_tiffinfo_validate $outfile
diff --git a/media-libs/tiff/files/tiff-4.7.0-test-directory-big-endian.patch b/media-libs/tiff/files/tiff-4.7.0-test-directory-big-endian.patch
new file mode 100644
index 000000000000..0eca0b69954f
--- /dev/null
+++ b/media-libs/tiff/files/tiff-4.7.0-test-directory-big-endian.patch
@@ -0,0 +1,328 @@
+https://gitlab.com/libtiff/libtiff/-/issues/652
+https://gitlab.com/libtiff/libtiff/-/issues/656
+https://gitlab.com/libtiff/libtiff/-/merge_requests/673
+
+From 388be62f9e2167ea076579e2605ff8eb91117ad6 Mon Sep 17 00:00:00 2001
+From: Su_Laus <sulau@freenet.de>
+Date: Wed, 30 Oct 2024 21:03:17 +0100
+Subject: [PATCH 1/3] Update test/test_directory.c not to fail on big-endian
+ machines.
+
+Closes #652
+--- a/test/test_directory.c
++++ b/test/test_directory.c
+@@ -1986,9 +1986,12 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ #define TIFFSeekFile_M(tif, off, whence) \
+ ((*TIFFGetSeekProc(tif))(TIFFClientdata(tif), (off), (whence)));
+
+- /* Code below does only handle Classic-TIFF without swapping". */
++ /* Code below does only handle Classic-TIFF without swapping. */
+ if (!(TIFFIsByteSwapped(tif) || TIFFIsBigTIFF(tif)))
+ {
++ /* Patch nextIFDOffset of IFD2, which is 0, with offset to itself.
++ * This generates an IFD3 without any elements at the end of file.
++ * Reading IFD3 should provoke reading error. */
+ uint64_t ss = TIFFSeekFile_M(tif, offsetBase[2], 0);
+ uint16_t cnt = 0;
+ uint64_t rr = TIFFReadFile_M(tif, &cnt, 2);
+@@ -1998,43 +2001,84 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ (void)rr;
+
+ /* Now there are offsets to four IFDs in the file, where the last one is
+- * not existing and has a non-valid dircount and entries behind EOF. */
++ * not existing and has a non-valid dircount and entries behind EOF.
++ * For LE-machines dircount is 458 (as offset) and for BE-machines
++ * dircount is zero. */
++#ifdef WORDS_BIGENDIAN
++ fprintf(stderr, "----- Expect error messages about 'Error fetching "
++ "directory count.' -----\n");
++#else
+ fprintf(stderr, "----- Expect error messages about 'Error fetching "
+ "directory link.' -----\n");
++#endif
+ /* TIFFNumberOfDirectories() returns 3 */
+ lastdir = TIFFNumberOfDirectories(tif);
+ TIFFSetDirectory(tif, 0);
+ CHECKCURDIRNUM_M(tif, 0, __LINE__);
++
++ /* TIFFSetDirectory(3) fails with error messages:
++ * TIFFFetchDirectory: test_current_dirnum_incrementing_wl.tif:
++ * Can not read TIFF directory.
++ * TIFFReadDirectory: Failed to read directory at offset 458. */
+ fprintf(stderr, "----- Expect error messages about 'Cannot read TIFF "
+ "directory.' -----\n");
+ if (TIFFSetDirectory(tif, 3))
+ {
+ fprintf(stderr,
+- "TIFFSetDirectory(3) for IFD4 was expected to fail but "
++ "TIFFSetDirectory(3) for IFD3 was expected to fail but "
+ "succeeded for %s "
+ "at %d\n",
+ filename, __LINE__);
+ goto failure;
+ }
++
+ /* Fails in 4.6.0 */
+ CHECKCURDIRNUM_M(tif, (tdir_t)(-1), __LINE__);
+ offsetBase[3] = TIFFCurrentDirOffset(tif);
+
+- /* Point IFD3 to a location within the file, where it has now a
+- * non-valid dircount=0. */
++ /* Point IFD3 to a location within the file, where it has now:
++ * - for LE-machines a non-valid dircount=0.
++ * - for BE-machines a dircount!=0 and dir is read with errors. */
+ ss = TIFFSeekFile_M(tif, offsetBase[2] + cnt * 12 + 2, 0);
+ wt = (uint32_t)(offsetBase[1] + 8);
+ rr = TIFFWriteFile_M(tif, &wt, 4);
++
++#ifdef WORDS_BIGENDIAN
++ fprintf(stderr, "----- Expect error messages about 'Error fetching "
++ "directory count.' -----\n");
++#else
+ fprintf(stderr, "----- Expect error messages about 'Error fetching "
+ "directory link.' -----\n");
++#endif
+ /* TIFFNumberOfDirectories() returns now 4 */
+ lastdir = TIFFNumberOfDirectories(tif);
+ TIFFSetDirectory(tif, 0);
+ CHECKCURDIRNUM_M(tif, 0, __LINE__);
++
++ /* For LE-machines the next TIFFSetDirectory(3) fails with error
++ * messages:
++ * test_current_dirnum_incrementing_wl.tif: Failed to allocate
++ * memory for to read TIFF directory (0 elements of 12 bytes each).
++ * TIFFReadDirectory: Failed to read directory at offset 178.
++ *
++ * For BE-machines, next TIFFSetDirectory(3) results in an error
++ * but that TIFFSetDirectory(3) sets the IFD active. Warning messages:
++ * TIFFReadDirectory: Warning, Unknown field with tag 1 (0x1)
++ * encountered.
++ * MissingRequired: TIFF directory is missing required
++ * "ImageLength" field.
++ */
++#ifdef WORDS_BIGENDIAN
++ fprintf(stderr,
++ "----- Expect error messages about ' Unknown field with tag 1 "
++ "(0x1) encountered.' AND 'MissingRequired: TIFF directory is "
++ "missing required ImageLength field.' -----\n");
++#else
+ fprintf(stderr,
+ "----- Expect error messages about 'Failed to allocate "
+ "memory for to read TIFF directory.' AND 'Failed to read "
+ "directory ..' -----\n");
++#endif
+ if (TIFFSetDirectory(tif, 3))
+ {
+ fprintf(stderr,
+@@ -2044,8 +2088,13 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ filename, __LINE__);
+ goto failure;
+ }
++
+ /* Fails in 4.6.0 */
++#ifdef WORDS_BIGENDIAN
++ CHECKCURDIRNUM_M(tif, (tdir_t)(3), __LINE__);
++#else
+ CHECKCURDIRNUM_M(tif, (tdir_t)(-1), __LINE__);
++#endif
+ }
+
+ unlink(filename);
+--
+GitLab
+
+
+From e201cd9d944fb18afdb385668008b0eb9d84cc80 Mon Sep 17 00:00:00 2001
+From: Su_Laus <sulau@freenet.de>
+Date: Sat, 16 Nov 2024 10:33:04 +0100
+Subject: [PATCH 2/3] Replace "#ifdef WORDS_BIGENDIAN" by restricting test on
+ little-endian TIFF files with swapping of patch data for BE-machines.
+
+--- a/test/test_directory.c
++++ b/test/test_directory.c
+@@ -1977,8 +1977,8 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ TIFFSetSubDirectory(tif, 0);
+ CHECKCURDIRNUM_M(tif, (tdir_t)(-1), __LINE__);
+
+-/*-- Patch offset of IFD2 to not existing IFD3 without entries.
+- * Thus TIFFFetchDirectory() will fail. --*/
++ /*-- Patch offset of IFD2 to not existing IFD3 without entries.
++ * Thus TIFFFetchDirectory() will fail. --*/
+ #define TIFFReadFile_M(tif, buf, size) \
+ ((*TIFFGetReadProc(tif))(TIFFClientdata(tif), (buf), (size)));
+ #define TIFFWriteFile_M(tif, buf, size) \
+@@ -1986,8 +1986,15 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ #define TIFFSeekFile_M(tif, off, whence) \
+ ((*TIFFGetSeekProc(tif))(TIFFClientdata(tif), (off), (whence)));
+
+- /* Code below does only handle Classic-TIFF without swapping. */
+- if (!(TIFFIsByteSwapped(tif) || TIFFIsBigTIFF(tif)))
++ /* ---------------------------------------------------------------------
++ * Test IFD index incrementing in case the functions return with certain
++ * errors. To provoke that errors, the file is patched by writing bytes
++ * directly into the file. Therefore, code below does only handle
++ * Classic-TIFF and little-endian files.
++ * The code works also on big endian machines, which have to swap some
++ * directly read/written values.
++ * --------------------------------------------------------------------- */
++ if (!(TIFFIsBigEndian(tif) || TIFFIsBigTIFF(tif)))
+ {
+ /* Patch nextIFDOffset of IFD2, which is 0, with offset to itself.
+ * This generates an IFD3 without any elements at the end of file.
+@@ -1995,23 +2002,22 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ uint64_t ss = TIFFSeekFile_M(tif, offsetBase[2], 0);
+ uint16_t cnt = 0;
+ uint64_t rr = TIFFReadFile_M(tif, &cnt, 2);
++ if (TIFFIsByteSwapped(tif))
++ TIFFSwabShort(&cnt);
+ ss = TIFFSeekFile_M(tif, offsetBase[2] + cnt * 12 + 2, 0);
+ uint32_t wt = (uint32_t)ss;
++ if (TIFFIsByteSwapped(tif))
++ TIFFSwabLong(&wt);
+ rr = TIFFWriteFile_M(tif, &wt, 4);
+ (void)rr;
+
+ /* Now there are offsets to four IFDs in the file, where the last one is
+ * not existing and has a non-valid dircount and entries behind EOF.
+- * For LE-machines dircount is 458 (as offset) and for BE-machines
+- * dircount is zero. */
+-#ifdef WORDS_BIGENDIAN
+- fprintf(stderr, "----- Expect error messages about 'Error fetching "
+- "directory count.' -----\n");
+-#else
++ * (dircount is 458 (as offset) */
+ fprintf(stderr, "----- Expect error messages about 'Error fetching "
+ "directory link.' -----\n");
+-#endif
+- /* TIFFNumberOfDirectories() returns 3 */
++ /* TIFFNumberOfDirectories() returns 3 and omits the invalid fourth IFD.
++ */
+ lastdir = TIFFNumberOfDirectories(tif);
+ TIFFSetDirectory(tif, 0);
+ CHECKCURDIRNUM_M(tif, 0, __LINE__);
+@@ -2033,52 +2039,41 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ }
+
+ /* Fails in 4.6.0 */
++ /* Reading invalid IFD 3 leads to an error and was not read in.
++ * Therefore, curdir shall be 65535 (non-existing directory) */
+ CHECKCURDIRNUM_M(tif, (tdir_t)(-1), __LINE__);
+ offsetBase[3] = TIFFCurrentDirOffset(tif);
+
+- /* Point IFD3 to a location within the file, where it has now:
+- * - for LE-machines a non-valid dircount=0.
+- * - for BE-machines a dircount!=0 and dir is read with errors. */
++ /* Point IFD3 to a location within the file, where it has now for
++ * little-endian TIFF files a non-valid dircount=0, which leads also to
++ * an error and the IFD is not read in. */
+ ss = TIFFSeekFile_M(tif, offsetBase[2] + cnt * 12 + 2, 0);
+ wt = (uint32_t)(offsetBase[1] + 8);
++ // wt = (uint32_t)(ss + 400);
++ if (TIFFIsByteSwapped(tif))
++ TIFFSwabLong(&wt);
+ rr = TIFFWriteFile_M(tif, &wt, 4);
+
+-#ifdef WORDS_BIGENDIAN
+- fprintf(stderr, "----- Expect error messages about 'Error fetching "
+- "directory count.' -----\n");
+-#else
+ fprintf(stderr, "----- Expect error messages about 'Error fetching "
+ "directory link.' -----\n");
+-#endif
+- /* TIFFNumberOfDirectories() returns now 4 */
++ /* TIFFNumberOfDirectories() returns now 4, because for an IFD linked
++ * list dircount=0 is not treated as an error and there is an offset
++ * (=1) to a next IFD. Then, at the fifth IFD a link error occurs. */
+ lastdir = TIFFNumberOfDirectories(tif);
+ TIFFSetDirectory(tif, 0);
+ CHECKCURDIRNUM_M(tif, 0, __LINE__);
+
+- /* For LE-machines the next TIFFSetDirectory(3) fails with error
+- * messages:
++ /* TIFFSetDirectory(3) fails with error messages:
+ * test_current_dirnum_incrementing_wl.tif: Failed to allocate
+ * memory for to read TIFF directory (0 elements of 12 bytes each).
+ * TIFFReadDirectory: Failed to read directory at offset 178.
+- *
+- * For BE-machines, next TIFFSetDirectory(3) results in an error
+- * but that TIFFSetDirectory(3) sets the IFD active. Warning messages:
+- * TIFFReadDirectory: Warning, Unknown field with tag 1 (0x1)
+- * encountered.
+- * MissingRequired: TIFF directory is missing required
+- * "ImageLength" field.
++ * The IFD 3 is not read in and curdir is set to 65535 (non-existing
++ * directory).
+ */
+-#ifdef WORDS_BIGENDIAN
+- fprintf(stderr,
+- "----- Expect error messages about ' Unknown field with tag 1 "
+- "(0x1) encountered.' AND 'MissingRequired: TIFF directory is "
+- "missing required ImageLength field.' -----\n");
+-#else
+ fprintf(stderr,
+ "----- Expect error messages about 'Failed to allocate "
+ "memory for to read TIFF directory.' AND 'Failed to read "
+ "directory ..' -----\n");
+-#endif
+ if (TIFFSetDirectory(tif, 3))
+ {
+ fprintf(stderr,
+@@ -2090,11 +2085,7 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ }
+
+ /* Fails in 4.6.0 */
+-#ifdef WORDS_BIGENDIAN
+- CHECKCURDIRNUM_M(tif, (tdir_t)(3), __LINE__);
+-#else
+ CHECKCURDIRNUM_M(tif, (tdir_t)(-1), __LINE__);
+-#endif
+ }
+
+ unlink(filename);
+--
+GitLab
+
+
+From b470af83d549e890e4ace55620405d06cff20ae5 Mon Sep 17 00:00:00 2001
+From: Su_Laus <sulau@freenet.de>
+Date: Mon, 18 Nov 2024 19:52:26 +0100
+Subject: [PATCH 3/3] Add two missing TIFFClose() in order to avoid memory
+ leaks. Closes #656
+
+--- a/test/test_directory.c
++++ b/test/test_directory.c
+@@ -1365,6 +1365,7 @@ int test_rewrite_lastdir_offset(unsigned int openMode)
+ filename, N_DIRECTORIES, count);
+ goto failure;
+ }
++ /* hint: file was closed by count_directories() */
+ unlink(filename);
+ return 0;
+
+@@ -1511,6 +1512,8 @@ int test_lastdir_offset(unsigned int openMode)
+ }
+ }
+ }
++ /* hint: files are always closed by count_directories() and
++ * get_dir_offsets() */
+ unlink(filename_optimized);
+ unlink(filename_non_optimized);
+ return 0;
+@@ -2088,6 +2091,7 @@ int test_current_dirnum_incrementing(int testcase, unsigned int openMode)
+ CHECKCURDIRNUM_M(tif, (tdir_t)(-1), __LINE__);
+ }
+
++ TIFFClose(tif);
+ unlink(filename);
+ return 0;
+
+@@ -2176,6 +2180,7 @@ int test_curdircount_setting(unsigned int openMode)
+ CHECKCURDIRNUM_M(tif, (tdir_t)(-1), __LINE__);
+ }
+
++ TIFFClose(tif);
+ unlink(filename);
+ return 0;
+
+--
+GitLab
diff --git a/media-libs/tiff/tiff-4.7.0-r1.ebuild b/media-libs/tiff/tiff-4.7.0-r1.ebuild
index 838fe7bab110..7ae0f0d5a033 100644
--- a/media-libs/tiff/tiff-4.7.0-r1.ebuild
+++ b/media-libs/tiff/tiff-4.7.0-r1.ebuild
@@ -21,7 +21,7 @@ S="${WORKDIR}/${PN}-$(ver_cut 1-3)"
LICENSE="libtiff"
SLOT="0/6"
if [[ ${PV} != *_rc* ]] ; then
- KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+ KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
IUSE="+cxx jbig jpeg lerc libdeflate lzma opengl static-libs test webp zlib zstd"
RESTRICT="!test? ( test )"
@@ -50,6 +50,11 @@ MULTILIB_WRAPPED_HEADERS=(
/usr/include/tiffconf.h
)
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-test-race.patch # bug#943020
+ "${FILESDIR}"/${P}-test-directory-big-endian.patch
+)
+
src_prepare() {
default
diff --git a/media-libs/tiff/tiff-4.7.0.ebuild b/media-libs/tiff/tiff-4.7.0.ebuild
index e1c35e00870a..84d12692c130 100644
--- a/media-libs/tiff/tiff-4.7.0.ebuild
+++ b/media-libs/tiff/tiff-4.7.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -45,6 +45,8 @@ MULTILIB_WRAPPED_HEADERS=(
/usr/include/tiffconf.h
)
+PATCHES=( "${FILESDIR}"/${P}-fix-test-race.patch ) # bug#943020
+
src_prepare() {
default