Ticket #1965 (closed defect: fixed)
libtiff PredictorEncodeTile alters passed buffer
| Reported by: | warmerdam | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.4 |
| Component: | GDAL_Raster | Version: | unspecified |
| Severity: | normal | Keywords: | gtiff libtiff |
| Cc: |
Description
PredictorEncodeTile?() in tif_predict.c alters the passed in buffer as it applies the predictor transformation. But the passed in buffer is assumed by code such as GTiffRasterBand::IWriteBlock() to *not* be altered by the call to TIFFWriteEncodedTile().
This function needs to be altered to do the predictor transformation into a temporary buffer instead of altering the original buffer.
This issue presumably exists in all libtiff versions, and results in corrupted GDAL block caches in some cases involving reading and writing to LZW or Deflate compressed TIFF files with an active predictor.
Currently this is causing tif_write_7 to fail in the autotest suite.
