libtiff: Fix Coverity Scan issue CID 1520761: Integer handling issues (OVERFLOW_BEFORE_WIDEN) tiffcrop.c: 9676 in rotateImage()

From 3f375931757b912ebbc6ebc57c1796728adaed1f Mon Sep 17 00:00:00 2001
From: Su_Laus <[EMAIL REDACTED]>
Date: Mon, 6 Feb 2023 21:10:30 +0100
Subject: [PATCH] Fix Coverity Scan issue CID 1520761: Integer handling issues
 (OVERFLOW_BEFORE_WIDEN) tiffcrop.c: 9676 in rotateImage()

---
 tools/tiffcrop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
index 519871ec..d7ad5ca8 100644
--- a/tools/tiffcrop.c
+++ b/tools/tiffcrop.c
@@ -9676,7 +9676,7 @@ static int rotateImage(uint16_t rotation, struct image_data *image,
                       "Integer overflow when calculating buffer size.");
             return (-1);
         }
-        buffsize = (rowsize + 1) * length;
+        buffsize = ((tmsize_t)rowsize + 1) * length;
     }
 
     bytes_per_sample = (bps + 7) / 8;