A regression has been identified in media-libs/tiff-4.4.0 and media-libs/tiff-4.4.0-r1 that causes corrupt TIFF files to be written by hylafaxplus when a TIFF page image contains multiple strips (multiple blocks of data for a single page in fax parlance). This has been reported to the TIFF library maintainers upstream and a merge that fixes the issue is available at: https://gitlab.com/libtiff/libtiff/-/merge_requests/430 The original issue is at: https://gitlab.com/libtiff/libtiff/-/issues/489 A patch that corrects this issue is as follows. Request that an updated media-libs/tiff ebuild be created that includes this patch until current upstream includes it. https://gitlab.com/libtiff/libtiff/-/merge_requests/430 Regression in tif_write.c causes hylafax to write corrupt TIFFs when multi-strip (multi-block) page images are written Fixes: https://gitlab.com/libtiff/libtiff/-/issues/489 --- a/libtiff/tif_write.c 2022-04-22 09:51:48.000000000 -0700 +++ b/libtiff/tif_write.c 2022-11-29 08:17:10.692592173 -0800 @@ -341,10 +341,13 @@ return ((tmsize_t) -1); } - tif->tif_curstrip = strip; + if (tif->tif_curstrip != strip) + { + tif->tif_curstrip = strip; - /* this informs TIFFAppendToStrip() we have changed or reset strip */ - tif->tif_curoff = 0; + /* this informs TIFFAppendToStrip() we have changed or reset strip */ + tif->tif_curoff = 0; + } if (td->td_stripsperimage == 0) { TIFFErrorExt(tif->tif_clientdata, module,"Zero strips per image"); Reproducible: Always Steps to Reproduce: Receive a fax containing more than one 'block' (64Kb data) in a single page image via hylafaxplus when media-libs/tiff-4.4.0 is installed. Actual Results: Resulting TIFF is corrupt and can be verified by its producing line-length mismatch warnings when run through tiffinfo -D. Expected Results: Expect working TIFF image (no errors or warnings from tiffinfo -D on resulting TIFF) Patch provided.
Created attachment 838375 [details, diff] Proposed patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33944343462c9aa5a0a23b4a296074d0bc62c5c2 commit 33944343462c9aa5a0a23b4a296074d0bc62c5c2 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-12-01 07:15:54 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-12-01 07:16:56 +0000 media-libs/tiff: backport fix for hylafaxplus regression Closes: https://bugs.gentoo.org/883641 Signed-off-by: Sam James <sam@gentoo.org> .../files/tiff-4.4.0-hylafaxplus-regression.patch | 34 +++++++ media-libs/tiff/tiff-4.4.0-r2.ebuild | 102 +++++++++++++++++++++ 2 files changed, 136 insertions(+)