libtiff: Merge branch 'fax2tiff_249' into 'master'

From 58b32c8ea640d0044dccb79d3076db7be4bfa7eb Mon Sep 17 00:00:00 2001
From: Lee Howard <[EMAIL REDACTED]>
Date: Fri, 15 Mar 2024 10:06:04 -0700
Subject: [PATCH] Fix fax2tiff issue #249, unreasonable width input

---
 tools/fax2tiff.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/fax2tiff.c b/tools/fax2tiff.c
index 27c88c34..46034e8f 100644
--- a/tools/fax2tiff.c
+++ b/tools/fax2tiff.c
@@ -151,6 +151,12 @@ int main(int argc, char *argv[])
                 break;
             case 'X': /* input width */
                 xsize = (uint32_t)atoi(optarg);
+                if (xsize < 1 || xsize > 10000)
+                {
+                    fprintf(stderr, "%s: The input width %s is not reasonable\n", argv[0],
+                            optarg);
+                    return EXIT_FAILURE;
+                }
                 break;
 
                 /* output-related options */