CSeverity: LowStatus: Fixed
PredictorEncodeTile ignores the differencing routine’s return value
PredictorEncodeTile() did not check the return value of the per-row differencing routine. PredictorEncodeRow() and PredictorDecodeTile() both check it. The routine can fail, for example when fpDiff() cannot allocate its temporary row buffer. The tile was still passed to the encoder, and TIFFWriteEncodedTile() reported success, although the written samples were not differenced, or only partly differenced, and do not read back as the original samples. Merge request 1033, opened by ucsurf, was folded into merge request 1052. Roger Leigh merged 1052 on 2026-11-30 (f895b1d). Commits 40c03e69 and cc0767d1, both authored by ucsurf Security, are on master.
The issue
PredictorEncodeTile() did not check the return value of the per-row differencing routine. PredictorEncodeRow() and PredictorDecodeTile() both check it. The routine can fail, for example when fpDiff() cannot allocate its temporary row buffer. The tile was still passed to the encoder, and TIFFWriteEncodedTile() reported success. The written samples were not differenced, or only partly differenced, and do not read back as the original samples.
The fix
The change frees the working copy and returns an error. Merge request 1033 was opened by ucsurf. Roger Leigh folded it into merge request 1052 and merged that request on 2026-11-30, merge commit f895b1d.
Two commits from merge request 1033 are on master. 40c03e69, authored by ucsurf Security on 2026-11-20, is the check in PredictorEncodeTile(). cc0767d1, authored by ucsurf Security on 2026-11-28, registers the regression test only when LZW is enabled.
Timeline
Fixed upstream 10 days after it was found.
- Found
- Reported via pull request
- Disclosed publicly
- Fix merged
- Entry last updated
Machine-readable: JSON · Markdown · ID bugs/c/libtiff__libtiff/2026-11-20-predictor-encode-tile-return-value
If this work is useful to you, you can support it on Buy Me a Coffee.