libtiff: Merge branch 'tiff2pdf_253' into 'master'

From d753cc15a2ed12ead52eec9a64ce551051c2caeb Mon Sep 17 00:00:00 2001
From: Lee Howard <[EMAIL REDACTED]>
Date: Fri, 15 Mar 2024 09:52:53 -0700
Subject: [PATCH] Fix tiff2pdf issue #253 - red and blue were being swapped for
 RGBA decoding

---
 tools/tiff2pdf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index a50e4f96..de06417f 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -4248,9 +4248,9 @@ tsize_t t2p_sample_rgba_to_rgb(tdata_t data, uint32_t samplecount)
     {
         sample = ((uint32_t *)data)[i];
         alpha = (uint8_t)((255 - ((sample >> 24) & 0xff)));
-        ((uint8_t *)data)[i * 3] = (uint8_t)((sample >> 16) & 0xff) + alpha;
+        ((uint8_t *)data)[i * 3 + 2] = (uint8_t)((sample >> 16) & 0xff) + alpha;
         ((uint8_t *)data)[i * 3 + 1] = (uint8_t)((sample >> 8) & 0xff) + alpha;
-        ((uint8_t *)data)[i * 3 + 2] = (uint8_t)(sample & 0xff) + alpha;
+        ((uint8_t *)data)[i * 3] = (uint8_t)(sample & 0xff) + alpha;
     }
 
     return (i * 3);