regression in v4.4.0 with repeated TIFFWriteRawStrip calls per page
Changes introduced in v4.4.0 cause corrupt TIFFs to be written by HylaFAX's occasional use of multiple TIFFWriteRawStrip calls per page.
Code changes made in September and December 2021 to the TIFFAppendToStrip function result in HylaFAX writing corrupt image data in the received fax TIFF files if HylaFAX writes those fax TIFF files using multiple calls per page to TIFFWriteRawStrip.
libtiff v4.3.0 works fine. libtiff v4.4.0 produces the problem.
HylaFAX sometimes makes multiple calls to TIFFWriteRawStrip to write a TIFF file. This is particularly true when a fax is received with error correction mode (ECM) and the page image data exceeds 64KB. HylaFAX will consequently write out the image data to the TIFF file in 64KB chunks, with whatever the (smaller) remainder is as the last chunk. To reproduce the problem with libtiff v4.4.0 one only needs to receive a fax with ECM and where the page image data exceeds 64KB.
This has been reproduced on Linux x64 systems.
The changes made in September and December 2021 to libtiff/tif_write.c and libtiff/tiffiop.h led to this problem. Reversing those changes resolves the problem. I have a patch, but don't see how to attach it with GitLab. The patch probably isn't important to you, though, as it's basically a reversal of those changes. The URLs for the GitLab commits are as follows: