https://github.com/libsdl-org/libtiff/commit/273983be9a3301871dc72afb2dae9d48102547e7
From 273983be9a3301871dc72afb2dae9d48102547e7 Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Sun, 20 Feb 2022 14:39:42 +0100
Subject: [PATCH] TIFFPrintDirectory(): avoid potential multi-threading issue
when reading the DotRange tag
The severity of the issue would be low (mix of values displayed) and the
time window where that would occur would be short.
---
libtiff/tif_print.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libtiff/tif_print.c b/libtiff/tif_print.c
index a071b124..f75c4381 100644
--- a/libtiff/tif_print.c
+++ b/libtiff/tif_print.c
@@ -574,6 +574,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
uint32_t value_count;
int mem_alloc = 0;
void *raw_data = NULL;
+ uint16_t dotrange[2]; /* must be kept in that scope and not moved in the below TIFFTAG_DOTRANGE specific case */
fip = TIFFFieldWithTag(tif, tag);
if(fip == NULL)
@@ -607,7 +608,6 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
handled this way ... likely best if we move it into
the directory structure with an explicit field in
libtiff 4.1 and assign it a FIELD_ value */
- static uint16_t dotrange[2];
raw_data = dotrange;
TIFFGetField(tif, tag, dotrange+0, dotrange+1);
} else if (fip->field_type == TIFF_ASCII