libtiff: Fix copy paste error.

From 4b54117c6d0b35af2e547216137b46d5b1762231 Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Mon, 24 Jul 2023 19:23:58 +0000
Subject: [PATCH] Fix copy paste error.

---
 test/test_write_read_tags.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test_write_read_tags.c b/test/test_write_read_tags.c
index c51269de..227f6ba3 100644
--- a/test/test_write_read_tags.c
+++ b/test/test_write_read_tags.c
@@ -1009,7 +1009,7 @@ int write_all_tags(TIFF *tif, const TIFFFieldArray *tFieldArray,
                 if ((tSetFieldType == TIFF_SETGET_UINT8) &&
                     (auxInt32ArrayW[i] > 255))
                     auxInt32ArrayW[i] = 255;
-                else if ((tSetFieldType == TIFF_SETGET_UINT8) &&
+                else if ((tSetFieldType == TIFF_SETGET_UINT16) &&
                          (auxInt32ArrayW[i] > 65535))
                     auxInt32ArrayW[i] = 65535;
                 if (tTag == TIFFTAG_FILLORDER)