summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/gzip/ftgzip.c
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-08-14 11:13:36 +0200
committerLiang Qi <liang.qi@qt.io>2019-10-30 08:48:18 +0100
commit58f56950848bae9c90da3873090c7698e0128b12 (patch)
tree0b3127cd313aaf34d59355deed2e2acc5341eff3 /src/3rdparty/freetype/src/gzip/ftgzip.c
parentc51ca1d1b232ce1d6eaa9c6dd85de127e825d3af (diff)
Update bundled Freetype to 2.10.1
[ChangeLog][Freetype] Upgraded bundled Freetype version to 2.10.1. Fixes: QTBUG-77466 Change-Id: I1de8b8b03e0ffd0b17eeafff1017df7c638c9279 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
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 );