Commit f8555b5d8cdb76134175fc3260e06c8805ede867

Werner Lemberg 2014-04-03T05:45:38

Don't require `gzip' module for `sfnt'. Reported by Preet <prismatic.project@gmail.com>. * src/sfnt/sfobjs.c (woff_open_font): Guard use of FT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB.

diff --git a/ChangeLog b/ChangeLog
index d903984..745718a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-04-03  Werner Lemberg  <wl@gnu.org>
+
+	Don't require `gzip' module for `sfnt'.
+
+	Reported by Preet <prismatic.project@gmail.com>.
+
+	* src/sfnt/sfobjs.c (woff_open_font): Guard use of
+	FT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB.
+
 2014-03-27  Werner Lemberg  <wl@gnu.org>
 
 	Fix Savannah bug #38235.
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index a31c77c..0b1760c 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    SFNT object management (base).                                       */
 /*                                                                         */
-/*  Copyright 1996-2008, 2010-2013 by                                      */
+/*  Copyright 1996-2008, 2010-2014 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -661,6 +661,8 @@
       }
       else
       {
+#ifdef FT_CONFIG_OPTION_USE_ZLIB
+
         /* Uncompress with zlib. */
         FT_ULong  output_len = table->OrigLength;
 
@@ -675,6 +677,13 @@
           error = FT_THROW( Invalid_Table );
           goto Exit;
         }
+
+#else /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+        error = FT_THROW( Unimplemented_Feature );
+        goto Exit;
+
+#endif /* !FT_CONFIG_OPTION_USE_ZLIB */
       }
 
       FT_FRAME_EXIT();