# libtiff: Merge branch 'tiffcrop\_fix\_CoverityScan\_line\_9676' into 'master'

**URL:** <https://discourse.libsdl.org/t/libtiff-merge-branch-tiffcrop-fix-coverityscan-line-9676-into-master/42482>\
**Category:** SDL Commits\
**Created:** [February 7, 2023, 7:08pm UTC](https://discourse.libsdl.org/t/libtiff-merge-branch-tiffcrop-fix-coverityscan-line-9676-into-master/42482 "2023-02-07T19:08:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [February 7, 2023, 7:08pm UTC](https://discourse.libsdl.org/t/libtiff-merge-branch-tiffcrop-fix-coverityscan-line-9676-into-master/42482/1 "2023-02-07T19:08:08Z")

</div>

> <https://github.com/libsdl-org/libtiff/commit/c8e1289deff3fa60ba833ccec6c030934b02c281>
>
> Fix Coverity Scan issue CID 1520761: Integer handling issues...
> 
> See merge reque…st libtiff/libtiff!469

```diff
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;

```
