From 8d091a640bc61b4db26ed3639ce6a4a1a609ab7b Mon Sep 17 00:00:00 2001
From: Glenn Randers-Pehrson <glennrp at users.sourceforge.net>
Date: Mon, 1 Aug 2016 17:50:42 -0500
Subject: [PATCH] [libpng16] Conditionally compile png_decompress_chunk().

---
 ANNOUNCE   | 1 +
 CHANGES    | 1 +
 pngrutil.c | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/ANNOUNCE b/ANNOUNCE
index b1ed620b6..9321ffc6e 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -95,6 +95,7 @@ Version 1.6.24rc01 [July 25, 2016]
 
 Version 1.6.24rc02 [August 1, 2016]
   Conditionally compile SSE2 headers in contrib/intel/intel_sse.patch
+  Conditionally compile png_decompress_chunk().
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/CHANGES b/CHANGES
index 1d5d35137..1bc771bc1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5666,6 +5666,7 @@ Version 1.6.24rc01 [July 25, 2016]
 
 Version 1.6.24rc02 [August 1, 2016]
   Conditionally compile SSE2 headers in contrib/intel/intel_sse.patch
+  Conditionally compile png_decompress_chunk().
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/pngrutil.c b/pngrutil.c
index b77528d74..47ab61968 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -590,6 +590,7 @@ png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish,
    }
 }
 
+#if defined(PNG_READ_zTXt_SUPPORTED) || defined (PNG_READ_iTXt_SUPPORTED)
 /*
  * Decompress trailing data in a chunk.  The assumption is that read_buffer
  * points at an allocated area holding the contents of a chunk with a
@@ -754,6 +755,7 @@ png_decompress_chunk(png_structrp png_ptr,
       return Z_MEM_ERROR;
    }
 }
+#endif /* READ_zTXt || READ_iTXt */
 #endif /* READ_COMPRESSED_TEXT */
 
 #ifdef PNG_READ_iCCP_SUPPORTED
-- 
GitLab