You need to log in before you can comment on or make changes to this bug.
Created an attachment (id=319) [details] test progam TIFFWriteScanline corrupts the input buffer in the calling program with LZW and deflate (zip) compression when horizontal prediction is enabled for integer values or floating point prediction is enable for floating point values. This occurs with both libtiff 3.8.2 and 4.0.0beta3 (CVS). A test program for the integer case is attached. It should be run with and without the "-p" flag. The declaration of TIFFWriteScanline does not include the "const" qualifier for the buffer argument, so modifying values in the buffer is not, strictly speaking, in violation of the specification. It seems to me, however, that it is bad practice. It is certainly bad practice when not described in the man page for TIFFWriteScanline. One might argue that it is rare to rewrite or otherwise reuse an output buffer that has just been written to a file. I can testify from personal experience that it might be rare, but it does occur (and is a pain to track down when it happens).
Bugzilla is no longer used for tracking libtiff issues. Remaining open tickets, such as this one, have been migrated to the libtiff GitLab instance at https://gitlab.com/libtiff/libtiff/issues . The migrated tickets have their summary prefixed with [BZ#XXXX] where XXXX is the initial Bugzilla issue number.