From 1bcbc6bcf0540c6ba7c5f50895bfa51e496bc2fa Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Mon, 26 Jun 2023 15:19:34 +0200
Subject: [PATCH] tif_webp.c: fix signed vs unsigned comparison warnings (fix
previous commit)
---
libtiff/tif_webp.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libtiff/tif_webp.c b/libtiff/tif_webp.c
index ce15391e..c34b0b14 100644
--- a/libtiff/tif_webp.c
+++ b/libtiff/tif_webp.c
@@ -151,8 +151,9 @@ static int TWebPDecode(TIFF *tif, uint8_t *op, tmsize_t occ, uint16_t s)
int webp_width, webp_height;
if (!WebPGetInfo(tif->tif_rawcp,
- tif->tif_rawcc > UINT32_MAX ? UINT32_MAX
- : (uint32_t)tif->tif_rawcc,
+ (uint64_t)tif->tif_rawcc > UINT32_MAX
+ ? UINT32_MAX
+ : (uint32_t)tif->tif_rawcc,
&webp_width, &webp_height))
{
TIFFErrorExtR(tif, module, "WebPGetInfo() failed");
@@ -177,7 +178,7 @@ static int TWebPDecode(TIFF *tif, uint8_t *op, tmsize_t occ, uint16_t s)
const bool bWebPGetFeaturesOK =
WebPGetFeatures(tif->tif_rawcp,
- tif->tif_rawcc > UINT32_MAX
+ (uint64_t)tif->tif_rawcc > UINT32_MAX
? UINT32_MAX
: (uint32_t)tif->tif_rawcc,
&config.input) == VP8_STATUS_OK;