summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libtiff/files/CVE-2020-35524-2.patch
blob: 406d46776618184d152f13eacc78f6c5e5521357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From d74f56e3b7ea55c8a18a03bc247cd5fd0ca288b2 Mon Sep 17 00:00:00 2001
From: Thomas Bernard <miniupnp@free.fr>
Date: Tue, 10 Nov 2020 02:05:05 +0100
Subject: [PATCH] Fix for building without JPEG support

Upstream-Status: Backport
https://gitlab.com/libtiff/libtiff/-/commit/d74f56e3b7ea55c8a18a03bc247cd5fd0ca288b2
https://gitlab.com/libtiff/libtiff/-/merge_requests/159/commits
CVE: CVE-2021-35524
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
---
 tools/tiff2pdf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index dc69d2f9..d0b0ede7 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -2087,10 +2087,13 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
 #endif
 		(void) 0;
 	}
+#ifdef JPEG_SUPPORT
 	if(t2p->pdf_compression == T2P_COMPRESS_JPEG
 	   && t2p->tiff_photometric == PHOTOMETRIC_YCBCR) {
 		k = checkMultiply64(TIFFNumberOfStrips(input), TIFFStripSize(input), t2p);
-	} else {
+	} else
+#endif
+	{
 		k = checkMultiply64(TIFFScanlineSize(input), t2p->tiff_length, t2p);
 		if(t2p->tiff_planar==PLANARCONFIG_SEPARATE){
 			k = checkMultiply64(k, t2p->tiff_samplesperpixel, t2p);
-- 
GitLab