libtiff: Merge branch 'prepare_v4_6_0' into 'master'

From a4acea370faad56528f940befeb6d982ea71b846 Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Tue, 5 Sep 2023 15:04:12 +0200
Subject: [PATCH 1/3] Prepare for libtiff 4.6.0 release

---
 ChangeLog               | 366 ++++++++++++++++++++++++++++++++++++++++
 RELEASE-DATE            |   2 +-
 VERSION                 |   2 +-
 configure.ac            |   8 +-
 doc/Makefile.am         |   2 +
 doc/index.rst           |  13 +-
 doc/releases/index.rst  |   1 +
 doc/releases/v4.6.0.rst | 153 +++++++++++++++++
 8 files changed, 529 insertions(+), 18 deletions(-)
 create mode 100644 doc/releases/v4.6.0.rst

diff --git a/ChangeLog b/ChangeLog
index 21248161..87b5f126 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,369 @@
+2023-09-05  Even Rouault  <even.rouault@spatialys.com>
+
+	libtiff v4.6.0 released
+
+2023-09-05  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_600' into 'master'
+	CMake: fix build with -Dstrip-chopping=off (fixes #600)
+
+	See merge request libtiff/libtiff!527
+
+2023-09-05  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'georgthegreat-master-patch-87447' into 'master'
+	Fix using __attribute__ libtiff with clang-for-windows
+
+	See merge request libtiff/libtiff!525
+
+2023-09-05  Yuriy Chernyshov  <georgthegreat@gmail.com>
+
+	Fix using __attribute__ libtiff with clang-for-windows.
+
+2023-09-05  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'manpage_TIFFField_docu_update' into 'master'
+	manpages: TiffField functions documentation updated with return behaviour for...
+
+	See merge request libtiff/libtiff!526
+
+2023-09-05  Even Rouault  <even.rouault@spatialys.com>
+
+	CMake: fix build with -Dstrip-chopping=off (fixes #600)
+
+2023-09-03  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'consistently_update_TIFF-version_from_configure-ac' into 'master'
+	Update CMake and autoconf scripts to consistently update LibTIFF version...
+
+	See merge request libtiff/libtiff!456
+
+2023-09-03  Su Laus  <sulau@freenet.de>
+
+	Update CMake and autoconf scripts to consistently update LibTIFF version defines and references in various files when version definition in configure.ac has been changed.
+	- Move in tiffvers.h from .\libtiff source directory to .\libtiff  build directory.
+	- Remove unused version information from tif_config.h
+	- With every CMake build the version defines (e.g. 4.5.1) within tiffvers.h are consistently updated from configure.ac. The version release-date is taken from file RELEASE-DATE.
+	- The files VERSION and RELEASE-DATE are only updated with a special CMake target build: cmake --build . --target tiff_release.
+
+	- For autotools, version information is updated from configure.ac with ./autogen.sh. LIBTIFF_RELEASE_DATE is taken form file RELEASE-DATE.
+	- ./configure generates tiffvers.h with the cached version information and LIBTIFF_RELEASE_DATE.
+	- "make release" updates tiffvers.h and VERSION file with cached version info and RELEASE-DATE file and tiffves.h with the current date.
+
+2023-08-28  Su_Laus  <sulau@freenet.de>
+
+	manpages: TiffField functions documentation updated with return behaviour for not defined tags and determination of write-/read-count size.
+
+2023-08-22  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'change_long_to_int32_t_in_two_test_apps' into 'master'
+	Change "long" to "int32_t" in two test apps, because can be either int32_t or...
+
+	See merge request libtiff/libtiff!524
+
+2023-08-21  Su_Laus  <sulau@freenet.de>
+
+	Change "long" to "int32_t" in two test apps, because can be either int32_t or int64_t, depending on compiler and system.
+
+2023-08-16  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'CI_CMake_static_build' into 'master'
+	Add static build for CI/CD to run testcases which need private interface functions.
+
+	See merge request libtiff/libtiff!521
+
+2023-08-16  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_#597_tiffset_different_signedness' into 'master'
+	tiffset fix #597: warning: comparison of integer expressions of different signedness.
+
+	Closes #597
+
+	See merge request libtiff/libtiff!523
+
+2023-08-16  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'tiffcp_remove_i_option' into 'master'
+	tiffcp: remove -i option (ignore errors)
+
+	See merge request libtiff/libtiff!522
+
+2023-08-16  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'move_tools_to_unsupported_a_archive' into 'master'
+	Move most TIFF tools to archive and keep some as unsupported (see #580).
+
+	See merge request libtiff/libtiff!520
+
+2023-08-16  Su Laus  <sulau@freenet.de>
+
+	Move most TIFF tools to archive and keep some as unsupported (see #580).
+
+2023-08-12  Su_Laus  <sulau@freenet.de>
+
+	Add static build for CI/CD to run testcases which need private interface functions.
+
+	tiffset fix #597: warning: comparison of integer expressions of different signedness.
+
+	Remove -i option (ignore errors) from tiffcp, because almost all fuzzer issues were consequential errors from ignored errors because of the "-i" option.
+
+2023-08-11  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_585_test_write_read_tags_autoconf' into 'master'
+	Add missing test_write_read_tags.c and test_transferfunction_write_read.c in...
+
+	Closes #585
+
+	See merge request libtiff/libtiff!519
+
+2023-07-24  Even Rouault  <even.rouault@spatialys.com>
+
+	Fix copy paste error.
+
+2023-07-23  Su_Laus  <sulau@freenet.de>
+
+	Add missing test_write_read_tags.c and test_transferfunction_write_read.c in tarball (fixes #585) and correct „long“ issue.
+	Don't use "long" because can be int32_t or int64_t, depending on compiler and system.
+
+2023-07-20  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'clang-format-tools' into 'master'
+	Automatically format with clang-format
+
+	See merge request libtiff/libtiff!518
+
+2023-07-20  Timothy Lyanguzov  <timothy.lyanguzov@sap.com>
+
+	Automatically format with clang-format.
+
+2023-07-20  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_589' into 'master'
+	TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and...
+
+	Closes #589
+
+	See merge request libtiff/libtiff!514
+
+2023-07-20  Even Rouault  <even.rouault@spatialys.com>
+
+	TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and...
+
+2023-07-19  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'master-patch-6fc6' into 'master'
+	raw2tiff: fix integer overflow and bypass of the check (fixes #592)
+
+	See merge request libtiff/libtiff!516
+
+2023-07-19  Arie Haenel  <arie.haenel@jct.ac.il>
+
+	raw2tiff: fix integer overflow and bypass of the check (fixes #592)
+
+2023-07-19  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'master-patch-05a4' into 'master'
+	tiffcp: fix memory corruption (overflow) on hostile images (fixes #591)
+
+	See merge request libtiff/libtiff!515
+
+2023-07-19  Arie Haenel  <arie.haenel@jct.ac.il>
+
+	tiffcp: fix memory corruption (overflow) on hostile images (fixes #591)
+
+2023-07-17  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix-numtrunc' into 'master'
+	fix numtrunc at tiff_dirread.c
+
+	See merge request libtiff/libtiff!512
+
+2023-07-17  headshog  <craaaaaachind@gmail.com>
+
+	TIFFReadDirectoryCheckOrder: avoid integer overflow.
+	When it occurs, it should be harmless in practice though
+
+2023-07-17  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'webp_lossless_exact' into 'master'
+	WebP codec: turn exact mode when creating lossless files to avoid altering...
+
+	See merge request libtiff/libtiff!511
+
+2023-07-11  Even Rouault  <even.rouault@spatialys.com>
+
+	WebP codec: turn exact mode when creating lossless files to avoid altering R,G,B values in areas where alpha=0
+	Fixes https://github.com/OSGeo/gdal/issues/8038
+
+2023-07-05  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'webp_reg_fix' into 'master'
+	WebP decoder: fix error when reading a 3-band blob in a RGBA image
+
+	See merge request libtiff/libtiff!510
+
+2023-07-05  Even Rouault  <even.rouault@spatialys.com>
+
+	WebP decoder: fix error when reading a 3-band blob in a RGBA image.
+	Fixes regression of 350ff161c8a61b6483a1e4689e09cd47dd0dd5f9 (master only)
+
+2023-06-26  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'appveyor_fix' into 'master'
+	.appveyor.yml: workaround build error
+
+	See merge request libtiff/libtiff!509
+
+2023-06-26  Even Rouault  <even.rouault@spatialys.com>
+
+	.appveyor.yml: workaround build error.
+
+2023-06-26  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'tif_webp_warning_fixes' into 'master'
+	tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit)
+
+	See merge request libtiff/libtiff!508
+
+2023-06-26  Even Rouault  <even.rouault@spatialys.com>
+
+	tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit)
+
+2023-06-26  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_TransferFunction_writing' into 'master'
+	Fix TransferFunction writing of only two transfer functions.
+
+	See merge request libtiff/libtiff!502
+
+2023-06-26  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_581_582' into 'master'
+	WebP decoder: validate WebP blob width, height, band count against TIFF parameters
+
+	Closes #582 et #581
+
+	See merge request libtiff/libtiff!507
+
+2023-06-19  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'warning_cmake_config_file' into 'master'
+	v4.5.1 release note: add warning about CMake config file being preview
+
+	See merge request libtiff/libtiff!506
+
+2023-06-17  Even Rouault  <even.rouault@spatialys.com>
+
+	WebP decoder: validate WebP blob width, height, band count against TIFF parameters
+	to avoid use of uninitialized variable, or decoding corrupted content
+	without explicit error
+
+	Fixes #581, fixes #582
+
+2023-06-15  Even Rouault  <even.rouault@spatialys.com>
+
+	v4.5.1 release note: add warning about CMake config file being preview.
+
+2023-06-14  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'HOWTO-RELEASE-gitlab-release' into 'master'
+	HOWTO-RELEASE: mention creating a gitlab release
+
+	See merge request libtiff/libtiff!505
+
+2023-06-14  Even Rouault  <even.rouault@spatialys.com>
+
+	HOWTO-RELEASE: mention creating a gitlab release.
+
+2023-06-10  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'TIFFOpenWExt_O_RDWR' into 'master'
+	TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux
+
+	See merge request libtiff/libtiff!504
+
+2023-06-10  Even Rouault  <even.rouault@spatialys.com>
+
+	TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux
+
+2023-06-10  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_ossfuzz_59751' into 'master'
+	TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL
+
+	See merge request libtiff/libtiff!503
+
+2023-06-10  Even Rouault  <even.rouault@spatialys.com>
+
+	TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL.
+	Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59751
+
+	In 738e0409 (refs #575), we disabled DNG / EP tags, but there was a
+	special proessing for TIFFTAG_EP_BATTERYLEVEL that must be disabled
+	since the tag is no longer defined.
+
+2023-06-09  Su_Laus  <sulau@freenet.de>
+
+	Fix TransferFunction writing of only two transfer functions. The TIFFWriteDirectoryTagTransferfunction() function writes in some cases only two transfer functions, although only exactly one or exactly three transfer functions are allowed. This then leads to an error when reading. --> TIFFReadDirectory: Warning, Incorrect count for "TransferFunction"; tag ignored.
+	This MR corrects the behaviour of TIFFWriteDirectoryTagTransferfunction() accordingly. Furthermore, a possible buffer overflow is avoided.
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_win_build' into 'master'
+	Fix Windows build
+
+	Closes #578
+
+	See merge request libtiff/libtiff!501
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	cmake/PkgConfig.cmake: avoid CMake error when prefix or suffix is empty.
+
+	Add tif_win32_versioninfo.rc and tif_tools_versioninfo.rc to EXTRA_DIST.
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_coverity_build' into 'master'
+	build/gitlab-ci: fix coverity_build()
+
+	See merge request libtiff/libtiff!499
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	build/gitlab-ci: fix coverity_build()
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'v4.5.1rc1_preparation' into 'master'
+	Prepare release 4.5.1
+
+	See merge request libtiff/libtiff!498
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	Prepare for v4.5.1 release.
+
+	Merge remote-tracking branch 'sulaus/Rel_4.5.1_preparation'
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'disable_dng_tags' into 'master'
+	tif_dirinfo.c: disable DNG 1.2->1.6 tags
+
+	Closes #575
+
+	See merge request libtiff/libtiff!497
+
+2023-06-09  Even Rouault  <even.rouault@spatialys.com>
+
+	Merge branch 'fix_577' into 'master'
+	CMake related fixes
+
+	Closes #577
+
+	See merge request libtiff/libtiff!496
+
 2023-06-09  Even Rouault  <even.rouault@spatialys.com>
 
 	libtiff v4.5.1 released
diff --git a/RELEASE-DATE b/RELEASE-DATE
index a4ca097f..81d28a37 100644
--- a/RELEASE-DATE
+++ b/RELEASE-DATE
@@ -1 +1 @@
-20230609
+20230905
diff --git a/VERSION b/VERSION
index 4404a17b..6016e8ad 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.5.1
+4.6.0
diff --git a/configure.ac b/configure.ac
index 8556239e..c65d8622 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ dnl OF THIS SOFTWARE.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.64)
-AC_INIT([LibTIFF Software],[4.5.1],[tiff@lists.maptools.org],[tiff])
+AC_INIT([LibTIFF Software],[4.6.0],[tiff@lists.maptools.org],[tiff])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(m4)
 AC_LANG(C)
@@ -40,8 +40,8 @@ AM_MAINTAINER_MODE
 dnl Versioning.
 dnl Don't fill the ALPHA_VERSION field, if not applicable.
 LIBTIFF_MAJOR_VERSION=4
-LIBTIFF_MINOR_VERSION=5
-LIBTIFF_MICRO_VERSION=1
+LIBTIFF_MINOR_VERSION=6
+LIBTIFF_MICRO_VERSION=0
 LIBTIFF_ALPHA_VERSION=
 LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
 dnl This (LIBTIFF_RELEASE_DATE) is used to set the #define TIFFLIB_VERSION in tiffvers.h.
@@ -78,7 +78,7 @@ dnl     increment age.
 dnl  6. If any interfaces have been removed since the last public release,
 dnl     then set age to 0.                                
 LIBTIFF_CURRENT=6
-LIBTIFF_REVISION=1
+LIBTIFF_REVISION=2
 LIBTIFF_AGE=0
 LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
 
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 02d5d0bd..f5cb7226 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -178,6 +178,7 @@ rst_sources = \
 	releases/v3.7.2.rst \
 	releases/v4.5.0.rst \
 	releases/v4.5.1.rst \
+	releases/v4.6.0.rst \
 	functions.rst \
 	tools.rst \
 	terms.rst \
@@ -242,6 +243,7 @@ rst_sources = \
 	functions/TIFFSetTagExtender.rst \
 	functions/TIFFStrileQuery.rst \
 	libtiff.rst \
+	multi_page.rst \
 	images.rst
 
 EXTRA_DIST = \
diff --git a/doc/index.rst b/doc/index.rst
index d08a51ca..8d3061e6 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -10,8 +10,7 @@ LibTIFF - TIFF Library and Utilities
     =====================  =====================================
     Home Page #1           http://www.simplesystems.org/libtiff/
     Home Page #2           https://libtiff.gitlab.io/libtiff/
-    Home Page #3           http://libtiff.maptools.org/
-    Latest Stable Release  v4.5.1
+    Latest Stable Release  v4.6.0
     Master Download Site   `download.osgeo.org <https://download.osgeo.org/libtiff/>`_
     Mailing List           `tiff@lists.osgeo.org <tiff@lists.osgeo.org>`_
     List subscription      http://lists.osgeo.org/mailman/listinfo/tiff/
@@ -35,16 +34,6 @@ your needs for reading and writing TIFF images.
 LibTIFF is portable software, supported on various operating systems including
 UNIX (Linux, BSD, MacOS X) and Windows.
 
-.. warning::
-
-    libtiff v4.5.1 will be the last one supporting most TIFF tools (except tiffinfo,
-    tiffdump, tiffcp and tiffset), whose maintenance will be discontinued, due
-    to the lack of contributors able to address reported security issues.
-    Starting with libtiff v4.6.0, their source code, at this time ,will still be
-    available in the source distribution, but they will no longer be built by
-    default, and issues related to them will no longer be accepted in the
-    libtiff bug tracker.
-
 The following sections are included in this documentation:
 
 .. toctree::
diff --git a/doc/releases/index.rst b/doc/releases/index.rst
index ea19c92f..f9eb1211 100644
--- a/doc/releases/index.rst
+++ b/doc/releases/index.rst
@@ -7,6 +7,7 @@ LibTIFF releases.
     :maxdepth: 1
     :titlesonly:
 
+    v4.6.0
     v4.5.1
     v4.5.0
     v4.4.0
diff --git a/doc/releases/v4.6.0.rst b/doc/releases/v4.6.0.rst
new file mode 100644
index 00000000..7b5cc778
--- /dev/null
+++ b/doc/releases/v4.6.0.rst
@@ -0,0 +1,153 @@
+Changes in TIFF v4.6.0
+======================
+
+.. table:: References
+    :widths: auto
+
+    ======================  ==========================================
+    Current Version         v4.6.0 (:tag:`v4.6.0`)
+    Previous Version        :doc:`v4.5.1 <v4.5.1>`
+    Master Download Site    `<https://download.osgeo.org/libtiff/>`_
+    Master HTTP Site #1     `<http://www.simplesystems.org/libtiff/>`_
+    Master HTTP Site #2     `<https://libtiff.gitlab.io/libtiff/>`_
+    ======================  ==========================================
+
+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 :file:`ChangeLog` file
+included in the release package and by the Git commit history:
+
+Major changes
+-------------
+
+.. warning::
+
+    This version removes a big number of utilities that have suffered from lack
+    of maintenance over the years and were the source of various reported
+    security issues.
+    See "Removed functionality" below for the list of removed utilities.
+    Starting with libtiff v4.6.0, their source code, at this time, will still be
+    available in the source distribution, but they will no longer be built by
+    default, and issues related to them will no longer be accepted in the
+    libtiff bug tracker.
+    The only remaining supported TIFF tools are tiffinfo, tiffdump, tiffcp,
+    tiffset and tiffsplit.
+
+
+Software configuration changes
+------------------------------
+
+* TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and
+  TIFF_LIBRARIES for compatibility with FindTIFF.cmake as shipped by CMake
+  (fixes :issue:`589`)
+
+* Update CMake and autoconf scripts to consistently update LibTIFF version
+  defines and references in various files when version definition in
+  configure.ac has been changed.
+
+  - Move in tiffvers.h from libtiff source directory to libtiff build directory.
+  - Remove unused version information from tif_config.h
+  - With every CMake build the version defines (e.g. 4.5.1) within tiffvers.h
+    are consistently updated from configure.ac. The version release-date is
+    taken from file RELEASE-DATE.
+  - The files VERSION and RELEASE-DATE are only updated with a special CMake
+    target build: cmake --build . --target tiff_release.
+  - For autotools, version information is updated from configure.ac with
+    ./autogen.sh. LIBTIFF_RELEASE_DATE is taken form file RELEASE-DATE.
+  - ./configure generates tiffvers.h with the cached version information and
+    LIBTIFF_RELEASE_DATE.
+  - "make release" updates tiffvers.h and VERSION file with cached version info
+    and RELEASE-DATE file and tiffves.h with the current date.
+
+* CMake: fix build with -Dstrip-chopping=off (fixes :issue:`600`)
+
+Library changes
+---------------
+
+New/improved functionalities:
+
+* Fix using ``__attribute__`` libtiff with clang-for-windows
+
+API/ABI breaks:
+
+* None
+
+Bug fixes:
+
+* WebP decoder: validate WebP blob width, height, band count against TIFF
+  parameters to avoid use of uninitialized variable, or decoding corrupted
+  content without explicit error (fixes :issue:`581`,  :issue:`582`).
+
+* WebP codec: turn exact mode when creating lossless files to avoid altering
+  R,G,B values in areas where alpha=0 (https://github.com/OSGeo/gdal/issues/8038)
+
+* Fix TransferFunction writing of only two transfer functions.
+
+* TIFFReadDirectoryCheckOrder: avoid integer overflow. When it occurs, it
+  should be harmless in practice though
+  (https://gitlab.com/libtiff/libtiff/-/merge_requests/512)
+
+Documentation
+-------------
+
+* TiffField functions documentation updated with return behaviour for not
+  defined tags and determination of write-/read-count size.
+
+Tools changes
+-------------
+
+Removed functionality:
+
+* The following tools are no longer compiled and have been moved to archive/tools:
+
+  - fax2ps
+  - fax2tiff
+  - pal2rgb
+  - ppm2tiff
+  - raw2tiff
+  - rgb2ycbcr
+  - thumbnail
+  - tiff2bw
+  - tiff2rgba
+  - tiffcmp
+  - tiffcrop
+  - tiffdither
+  - tiffgt
+  - tiffmedian
+
+* The following tools are no longer compiled by default: tiff2ps and tiff2pdf.
+  They have been moved to tools/unsupported. 
+  They can be built by setting ``--enable-tools-unsupported`` for autoconf,
+  or ``-Dtiff-tools-unsupported`` for CMake, but as the name imply, they are
+  no longer supported by upstream. Packagers are suggested *not* to enable those
+  options.
+
+* tiffcp: remove -i option (ignore errors), because almost all
+  fuzzer issues were consequential errors from ignored errors because of the
+  "-i" option.
+
+New/improved functionality:
+
+* None
+
+Bug fixes:
+
+* tiffset: fix #597: warning: comparison of integer expressions of different
+  signedness. (fixes :issue:`597`)
+
+* tiffcp: fix memory corruption (overflow) on hostile images
+  (fixes :issue:`591`)
+
+Test changes
+------------
+
+* Add missing test_write_read_tags.c and test_transferfunction_write_read.c
+  in tarball (fixes :issue:`585`) and correct "long" issue.
+
+* Don't use "long" because can be int32_t or int64_t, depending on compiler and
+  system.
+
+Changes to contributed and unsupported tools
+--------------------------------------------
+
+* raw2tiff: fix integer overflow and bypass of the check (fixes :issue:`592`)

From 5fd37d37e62a5eaef7b383dd1425972f78103f89 Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Tue, 5 Sep 2023 18:00:43 +0200
Subject: [PATCH 2/3] Fix references to mailing list

---
 cmake/AutotoolsCompat.cmake | 2 +-
 configure.ac                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmake/AutotoolsCompat.cmake b/cmake/AutotoolsCompat.cmake
index f491a8a1..e89b0e20 100644
--- a/cmake/AutotoolsCompat.cmake
+++ b/cmake/AutotoolsCompat.cmake
@@ -29,4 +29,4 @@ set(PACKAGE_NAME "LibTIFF Software")
 set(PACKAGE_TARNAME "${PROJECT_NAME}")
 set(PACKAGE_VERSION "${PROJECT_VERSION}${LIBTIFF_ALPHA_VERSION}")
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-set(PACKAGE_BUGREPORT "tiff@lists.maptools.org")
+set(PACKAGE_BUGREPORT "tiff@lists.osgeo.org")
diff --git a/configure.ac b/configure.ac
index c65d8622..b525eff2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ dnl OF THIS SOFTWARE.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.64)
-AC_INIT([LibTIFF Software],[4.6.0],[tiff@lists.maptools.org],[tiff])
+AC_INIT([LibTIFF Software],[4.6.0],[tiff@lists.osgeo.org],[tiff])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(m4)
 AC_LANG(C)

From f438759105c02904ba5578ffad9e214e5a3649fb Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Tue, 5 Sep 2023 23:06:24 +0200
Subject: [PATCH 3/3] doc/index.rst: add warning about tools removal

---
 doc/index.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/doc/index.rst b/doc/index.rst
index 8d3061e6..81355ccf 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -34,6 +34,16 @@ your needs for reading and writing TIFF images.
 LibTIFF is portable software, supported on various operating systems including
 UNIX (Linux, BSD, MacOS X) and Windows.
 
+.. warning::
+
+    Starting with libtiff v4.6.0, the source code for most TIFF tools (except tiffinfo,
+    tiffdump, tiffcp and tiffset) was discontinued, due to the lack of contributors
+    able to address reported security issues.
+    It will still be available in the source distribution, but they
+    will no longer be built by default, and issues related to them
+    will no longer be accepted in the libtiff bug tracker.
+
+
 The following sections are included in this documentation:
 
 .. toctree::