libtiff: Merge branch 'ci-ubuntu-22.04' into 'master'

From fa8b983a268e44105644efc72291e232a0d96333 Mon Sep 17 00:00:00 2001
From: Roger Leigh <[EMAIL REDACTED]>
Date: Sat, 4 Jun 2022 18:27:17 +0100
Subject: [PATCH 1/2] ci: Update to use Ubuntu 22.04 CI images

---
 .gitlab-ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 23abeeb9..3ee1b24c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,4 +1,4 @@
-image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu20.04:latest
+image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu22.04:latest
 
 stages:
   - build
@@ -24,7 +24,7 @@ cmake-ninja:
 
 coverity:
   stage: static-analysis
-  image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu20.04-coverity:latest
+  image: registry.gitlab.com/libtiff/libtiff-ci-ubuntu22.04-coverity:latest
   script:
     - sh build/gitlab-ci coverity "Ninja" Debug
   only:

From 7643b4c434bc0681e6cf65b886c6c9fa9ce7988e Mon Sep 17 00:00:00 2001
From: Roger Leigh <rleigh@codelibre.net>
Date: Sat, 4 Jun 2022 19:56:51 +0100
Subject: [PATCH 2/2] tiffdump: Avoid overflow warning when reading

---
 tools/tiffdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/tiffdump.c b/tools/tiffdump.c
index 3d91c6ad..e4e239d1 100644
--- a/tools/tiffdump.c
+++ b/tools/tiffdump.c
@@ -192,7 +192,7 @@ dump(int fd, uint64_t diroff)
 		TIFFSwabShort(&hdr.common.tiff_version);
 	if (hdr.common.tiff_version==42)
 	{
-		if (read(fd, (char*) &hdr.classic.tiff_diroff, 4) != 4)
+		if (read(fd, ((char*) &hdr.classic) + offsetof(TIFFHeaderClassic, tiff_diroff), 4) != 4)
 			ReadError("TIFF header");
 		if (swabflag)
 			TIFFSwabLong(&hdr.classic.tiff_diroff);
@@ -205,7 +205,7 @@ dump(int fd, uint64_t diroff)
 	}
 	else if (hdr.common.tiff_version==43)
 	{
-		if (read(fd, (char*) &hdr.big.tiff_offsetsize, 12) != 12)
+		if (read(fd, ((char*) &hdr.big) + offsetof(TIFFHeaderBig, tiff_offsetsize), 12) != 12)
 			ReadError("TIFF header");
 		if (swabflag)
 		{