blob: 2020508fdf585b57c6c499046226e5bdf73b3429 [file] [log] [blame]
Patrick Williamsf52e3dd2024-01-26 13:04:43 -06001From 1e7d217a323eac701b134afc4ae39b6bdfdbc96a Mon Sep 17 00:00:00 2001
2From: Su_Laus <sulau@freenet.de>
3Date: Wed, 17 Jan 2024 06:57:08 +0000
4Subject: [PATCH] codec of input image is available, independently from codec
5 check of output image and return with error if not.
6
7Fixes #606.
8
9CVE: CVE-2023-6228
10Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/1e7d217a323eac701b134afc4ae39b6bdfdbc96a]
11
12Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
13---
14 tools/tiffcp.c | 2 ++
15 1 file changed, 2 insertions(+)
16
17diff --git a/tools/tiffcp.c b/tools/tiffcp.c
18index aff0626..a4f7f6b 100644
19--- a/tools/tiffcp.c
20+++ b/tools/tiffcp.c
21@@ -846,6 +846,8 @@ static int tiffcp(TIFF *in, TIFF *out)
22 if (!TIFFIsCODECConfigured(compression))
23 return FALSE;
24 TIFFGetFieldDefaulted(in, TIFFTAG_COMPRESSION, &input_compression);
25+ if (!TIFFIsCODECConfigured(input_compression))
26+ return FALSE;
27 TIFFGetFieldDefaulted(in, TIFFTAG_PHOTOMETRIC, &input_photometric);
28 if (input_compression == COMPRESSION_JPEG)
29 {
30--
312.40.0