summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/gzip/ftgzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/gzip/ftgzip.c')
-rw-r--r--src/3rdparty/freetype/src/gzip/ftgzip.c64
1 files changed, 30 insertions, 34 deletions
diff --git a/src/3rdparty/freetype/src/gzip/ftgzip.c b/src/3rdparty/freetype/src/gzip/ftgzip.c
index f8011c2dd8..5e78bc6f8d 100644
--- a/src/3rdparty/freetype/src/gzip/ftgzip.c
+++ b/src/3rdparty/freetype/src/gzip/ftgzip.c
@@ -1,23 +1,23 @@
-/***************************************************************************/
-/* */
-/* ftgzip.c */
-/* */
-/* FreeType support for .gz compressed files. */
-/* */
-/* This optional component relies on zlib. It should mainly be used to */
-/* parse compressed PCF fonts, as found with many X11 server */
-/* distributions. */
-/* */
-/* Copyright 2002-2018 by */
-/* David Turner, Robert Wilhelm, and Werner Lemberg. */
-/* */
-/* This file is part of the FreeType project, and may only be used, */
-/* modified, and distributed under the terms of the FreeType project */
-/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
-/* this file you indicate that you have read the license and */
-/* understand and accept it fully. */
-/* */
-/***************************************************************************/
+/****************************************************************************
+ *
+ * ftgzip.c
+ *
+ * FreeType support for .gz compressed files.
+ *
+ * This optional component relies on zlib. It should mainly be used to
+ * parse compressed PCF fonts, as found with many X11 server
+ * distributions.
+ *
+ * Copyright (C) 2002-2019 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
#include <ft2build.h>
@@ -41,10 +41,6 @@
#ifdef FT_CONFIG_OPTION_USE_ZLIB
-#ifdef FT_CONFIG_OPTION_PIC
-#error "gzip code does not support PIC yet"
-#endif
-
#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
#include <zlib.h>
@@ -637,8 +633,8 @@
memory = source->memory;
/*
- * check the header right now; this prevents allocating un-necessary
- * objects when we don't need them
+ * check the header right now; this prevents allocating un-necessary
+ * objects when we don't need them
*/
error = ft_gzip_check_header( source );
if ( error )
@@ -660,12 +656,12 @@
}
/*
- * We use the following trick to try to dramatically improve the
- * performance while dealing with small files. If the original stream
- * size is less than a certain threshold, we try to load the whole font
- * file into memory. This saves us from using the 32KB buffer needed
- * to inflate the file, plus the two 4KB intermediate input/output
- * buffers used in the `FT_GZipFile' structure.
+ * We use the following trick to try to dramatically improve the
+ * performance while dealing with small files. If the original stream
+ * size is less than a certain threshold, we try to load the whole font
+ * file into memory. This saves us from using the 32KB buffer needed
+ * to inflate the file, plus the two 4KB intermediate input/output
+ * buffers used in the `FT_GZipFile' structure.
*/
{
FT_ULong zip_size = ft_gzip_get_uncompressed_size( source );
@@ -735,7 +731,7 @@
/* check for `input' delayed to `inflate' */
- if ( !memory || ! output_len || !output )
+ if ( !memory || !output_len || !output )
return FT_THROW( Invalid_Argument );
/* this function is modeled after zlib's `uncompress' function */
@@ -750,7 +746,7 @@
stream.zfree = (free_func) ft_gzip_free;
stream.opaque = memory;
- err = inflateInit2( &stream, MAX_WBITS );
+ err = inflateInit2( &stream, MAX_WBITS|32 );
if ( err != Z_OK )
return FT_THROW( Invalid_Argument );