Changes since TIFF v4.7.2 (unreleased)¶
Current Version |
unreleased (master) |
Previous Version |
|
Primary Download Site |
|
Home HTTP Site #1 |
|
Home HTTP Site #2 |
This document provides a summary of significant changes made to the
software between the previous and current versions (see
above). A fully-detailed change summary is provided by the ChangeLog file
included in the release package and by the Git commit history.
Major changes¶
None
Software configuration changes¶
cmake: Make version 3.20 the minimum version required
autogen.sh: optionally obtain config.guess and config.sub from an adjacent gnulib checkout (issue #896)
Add a scan-build target to run clang's scan-build with options (issue #881)
Add the CMake option tiff-counted-by and the configure option --enable-counted-by (both off by default), which annotate the raw data buffer with the counted_by_or_null attribute for compilers that support it, so that -fsanitize=bounds can check accesses to it
configure.ac: build the 12-bit JPEG tests when a separate 12-bit libjpeg is used (--enable-jpeg12), as CMake already did
Library changes¶
New/improved functionalities:
ZSTD: implement the maximum compression ratio callback used by TIFFGetMaxCompressionRatio()
TIFFFieldWithTag(), TIFFFieldWithName(): only warn about unknown tags when enabled with TIFFOpenOptionsSetWarnAboutUnknownTags() (issue #863)
API/ABI breaks:
None
Bug fixes:
TIFFReadFromUserBuffer(): return 0 when the decoder fails, including CCITT fax decode failures that were previously reported as success
TIFFReadFromUserBuffer(): reject invalid input sizes (issue #932)
TIFFReadFromUserBuffer(): invalidate the temporary input state when it returns
TIFFReadEncodedTile(): return -1 when the tile decoder reports a failure, as the strip functions do. tiffcp now exits with status 1 on a malformed tiled fax image
TIFFReadScanline(): do not run the post-decode step when the decoder fails
tif_read, tif_write: refuse negative sizes in strip and tile I/O
TIFFReadBufferSetup(): report a failure instead of asserting (issue #868)
TIFFReadBufferSetup(): reset the decode position, avoiding a use-after-free when it is called between two TIFFReadScanline() calls on the same strip
TIFFCheckRead(): flush a pending scanline write before reading (issue #937)
TIFFReadRawTile1(): fix signed integer overflow in the mmap bounds check
tif_read, tif_write: harden the strip row calculation against overflow
TIFFStartTile(): reject a TileLength of zero
TIFFWriteTile(), TIFFReadTile(): fail when the tile index computed by TIFFComputeTile() overflows
tif_write: bound test the caller-supplied strip index (issue #903)
TIFFWriteCheck(): check the return value of TIFFForceStrileArrayWriting() (issue #884)
TIFFWriteBufferSetup(): refuse raw data buffer sizes of zero or less, and LZW: refuse raw data buffers smaller than five bytes
PackBits: refuse encoding into a raw data buffer that is too small
SGILog: do not overrun a small raw data buffer in the encoders
TIFFLinkDirectory(), TIFFWriteCustomDirectory(): fail if seeking to the end of the file fails (issue #944)
tif_win32: return -1 from the seek procedure on failure, so that seek failures are detected on Windows
TIFFRewriteDirectorySec(): detect IFD loops (issue #943)
TIFFWriteDirectorySec(): skip codec tags that cannot be fetched after a change of compression scheme, instead of writing uninitialized values
tif_dirwrite: replace assert() with runtime checks in the Short, Sshort and Rational array writers and for unknown custom field types
tif_dirwrite: use the checked allocation helpers for array allocations
tif_dirwrite: defensive hardening against a double free of the directory memory (issue #877)
tif_dirread: use overflow-checked allocations for directory entry arrays
Check the strile index before a lazy offset/bytecount fetch (issue #858)
TIFFCreateCustomDirectory(): check for a valid TIFFFieldArray (issue #916)
_TIFFMergeFields(): preserve the existing fields when reallocation fails
_TIFFmallocExt(), _TIFFreallocExt(): reject sizes of zero or less, which caused an out-of-bounds access when the cumulated memory limit is enabled
tif_dir: fix use-after-free in setByteArray() and when replacing a custom tag value
_TIFFVSetField(): drop a custom tag value that could not be allocated, or that was rejected, instead of leaving an entry with no value (issue #938)
TIFFPrintDirectory(): skip a tag when its value buffer cannot be allocated (issue #936)
tif_dir: setting BitsPerSample now keeps ColorMap and TransferFunction consistent with it: a ColorMap is kept while the new value fits its allocated capacity, so narrowing and then widening it again restores the original entries, and it is cancelled beyond that capacity; an explicitly set TransferFunction is cancelled on any BitsPerSample change (issue #901)
TIFFSetField(TIFFTAG_TRANSFERFUNCTION): report a missing curve and keep the previous value
PixarLog, SGILog: do not write a ColorMap, TransferFunction, SMinSampleValue or SMaxSampleValue that no longer matches the BitsPerSample, SampleFormat or SamplesPerPixel the codec forces when the directory is written. In particular, files written with SGILog LogL FLOAT data no longer keep SMinSampleValue and SMaxSampleValue
SGILog: check the result of the tag changes made when setting TIFFTAG_SGILOGDATAFMT
TIFFReadDirectory(): reset TIFF_POSTENCODE when changing directory
_TIFFSetDefaultCompressionState(): reset TIFF_UPSAMPLED, which made strip and scanline sizes of subsequent subsampled YCbCr directories too large
WebP, ZSTD, Deflate, LZMA, LERC: report an error instead of asserting on encode with a decode state
Decoders: clear the part of the caller buffer that is not decoded (CCITT fax, uncompressed, SGILog)
tif_getimage: fix heap out-of-bounds reads in gtStripContig() and gtTileContig() for subsampled YCbCr images
tif_getimage: fix heap overread and shifted output for sub-byte BitsPerSample with a column offset
tif_getimage: reject images where fromskew overflows int32_t
tif_getimage: scale fromskew by SamplesPerPixel in the 8-bit grey and palette put routines
TIFFReadRGBAImage(): align the handling of the requested orientation with the documentation (issue #791)
tif_fax3: fix incorrect success return on InitCCITTFax3() failure
tif_fax3: report one error, not two, for a row-size overflow in Fax3SetupState()
tif_jpeg: check the JPEGInitializeLibJPEG() return value
tif_jpeg: fix integer overflow in the JPEGDecode() value count computation (issue #891)
tif_jpeg: make 12-bit sample transitions explicit (issue #866)
JPEGPostEncode(): pad 12-bit downsampled data with whole rows, instead of compressing uninitialized memory
tif_jbig: validate the source extent before encoding (issue #866)
tif_predict: avoid aligned access to caller buffers (issue #866)
PixarLog, SGILog: avoid typed access to caller buffers (issue #866)
tif_predict: check the predictor return value in PredictorEncodeTile()
tif_lerc: fix integer overflow in the estimated compressed size calculation
tif_lzw: add missing read error handling in LZWDecodeCompat()
tif_luv: replace an assert() on the row alignment with runtime checks
tif_ojpeg: replace an assert() on the byte count with a runtime check
OJPEG, PixarLog: fix reachable integer overflows
PixarLog: decode tiled images using the tile dimensions
PixarLog: check the PixarLogMakeTables() return value
PixarLogEncode(): do not read past the input of a partial row
WebP: refuse PlanarConfig=Separate when encoding, and check the setup result in TWebPPreEncode()
TWebPPostEncode(): do not compress uninitialized memory
WebP: report errors with the names of the functions that raised them
tif_zip: fall back to zlib on LIBDEFLATE_INSUFFICIENT_SPACE instead of returning undefined data (issue #930)
ThunderScan, NeXT: honour the caller buffer contract
tif_stream: avoid casting failed C++ stream positions to unsigned values (issue #865)
Harden public raw multiplication overflow cases (issue #874)
tif_extension: check allocation failures (issue #872)
TIFFRGBAImage: use TIFFVStripSize() for packed subsampled YCbCr strips, so a strip whose scanline size rounds down no longer under-reads the last sampling rows (issue #945)
TIFFRGBAImage: reject a start column that falls inside a YCbCr sampling block instead of silently returning pixels shifted to the block boundary
_TIFFReadEncodedTileAndAllocBuffer(): check the tile's byte count rather than the raw buffer size in uncompressed mode, which wrongly rejected valid tiles
TIFFWriteDirectory(): report the rejected count and the maximum allowed when a custom tag count overflows the directory entry size
CCITT fax: zero the unused padding bits in the final byte of each decoded row when the width is not divisible by eight, instead of leaving them dependent on the caller buffer
SGILog, PixarLog: report buffer size multiplication overflows through the TIFF handle's error handler instead of the global one, and stop after the first failure
LERC: harden the segment size computations with checked multiplication
Parse the LIBTIFF_STRILE_ARRAY_MAX_RESIZE_COUNT and LIBTIFF_JPEGMAXALLOWEDSCANNUMBER environment variables strictly, rejecting malformed and negative values
Other changes:
The memory used to track directories now counts against the per-handle memory limit set with TIFFOpenOptionsSetMaxCumulatedMemAlloc()
Correct the value of TIFFTAG_ILLUMINANTDATA3 to 52535, to match the DNG specification
LZWEncode(): remove the _WINDOWS-specific hash entry handling
Declare the memory allocation functions in tiffio.h with allocation attributes, so compilers can diagnose mismatched deallocation and misused sizes; the deallocator attribute form is skipped on Intel and NVIDIA compilers (issue #880)
Documentation¶
Add an AI policy
Reporting bugs: remove private and stale email addresses and report security issues via GitLab (issue #942)
HOWTO-RELEASE: update for 2026, including the optional adjacent gnulib (issue #897), and use HTTPS for the release archive and signature links
TIFFRGBAImage, TIFFReadRGBAImage: document the requested orientation handling (issue #791)
TIFFComputeTile(): document that coordinates are not clamped
TIFFReadBufferSetup(): document the effect of replacing the buffer while reading scanlines
Tools changes¶
New/improved functionality:
None
Bug fixes:
tiffgt: check the TIFFReadDirectory() return value (issue #883)
tiff2bw, tiff2ps, tiffcrop: harden multiplication overflow cases (issue #874)
pal2rgb, raw2tiff, tiffmedian: check allocation failures (issue #872)
fax2tiff: release the TIFF handle used to decode the input
tiff2pdf: fix the build without CCITT support
tiff2pdf, tiffdump: do not call _TIFFmalloc() with a zero size
tiffmedian: refuse 16-bit input and skip extra samples, which were read as colour data and produced a palette image that did not match the input
Changes to contributed and unsupported tools¶
thumbnail: reject filter widths that overflow uint16_t
rgb2ycbcr, addtiffo, dbs, iptcutil, pds, ras2tiff, sgi2tiff, sgisv, ycbcr, tif2ras: check allocation failures (issue #872)
addtiffo: fix the destination pixel stride in TIFF_DownSample() for multi-byte samples (issue #852)
addtiffo: handle 32-bit signed integer samples (issue #977)
addtiffo: remove a redundant byte swap in TIFFWriteOvrRow() that corrupted multi-byte overview data (issue #978)
addtiffo: clamp the strip height to ImageLength, fixing a heap over-read with
-r averageon strips taller than the imageoss-fuzz: add fuzzers for TIFF decoding and the PackBits decoder, and update the decode and read_rgba fuzzers