https://github.com/libsdl-org/libtiff/commit/55514cd8250e88a7791a48b8a52a7a62def97610
From 55514cd8250e88a7791a48b8a52a7a62def97610 Mon Sep 17 00:00:00 2001
From: Su Laus <[EMAIL REDACTED]>
Date: Thu, 10 Feb 2022 20:39:43 +0000
Subject: [PATCH] tiff2pdf: Fixes issues #365, #258 and #257 related to
initializing 't2p->pdf_compressionquality'.
---
tools/tiff2pdf.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index 0bd909fb..e60a2dd0 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -1822,8 +1822,11 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
uint16_t predictor;
t2p->pdf_transcode = T2P_TRANSCODE_RAW;
t2p->pdf_compression=T2P_COMPRESS_ZIP;
- TIFFGetField(input, TIFFTAG_PREDICTOR, &predictor);
- t2p->pdf_compressionquality = predictor;
+ if (TIFFGetField(input, TIFFTAG_PREDICTOR, &predictor)) {
+ t2p->pdf_compressionquality = predictor;
+ } else {
+ t2p->pdf_compressionquality = PREDICTOR_NONE;
+ }
/* TIFFTAG_ZIPQUALITY is always Z_DEFAULT_COMPRESSION on reading */
}
}