From dba44cd4e5754b579f2184a864ffe7b79b0a7e56 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Mon, 2 Nov 2015 07:10:28 +0400 Subject: Update bundled FreeType to 2.6.1 Change-Id: Ic489f8aa8ad42da3922f542e6c9064afe44f3799 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/3rdparty/freetype/src/gzip/Jamfile | 2 +- src/3rdparty/freetype/src/gzip/ftgzip.c | 31 ++++++++++++++++++++----------- src/3rdparty/freetype/src/gzip/rules.mk | 11 ++++++++--- src/3rdparty/freetype/src/gzip/zutil.h | 2 +- 4 files changed, 30 insertions(+), 16 deletions(-) (limited to 'src/3rdparty/freetype/src/gzip') diff --git a/src/3rdparty/freetype/src/gzip/Jamfile b/src/3rdparty/freetype/src/gzip/Jamfile index a7aafa0518..0944a5f2c4 100644 --- a/src/3rdparty/freetype/src/gzip/Jamfile +++ b/src/3rdparty/freetype/src/gzip/Jamfile @@ -1,6 +1,6 @@ # FreeType 2 src/gzip Jamfile # -# Copyright 2001 by +# Copyright 2001-2015 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/src/3rdparty/freetype/src/gzip/ftgzip.c b/src/3rdparty/freetype/src/gzip/ftgzip.c index 2d4200d9fa..422035c00b 100644 --- a/src/3rdparty/freetype/src/gzip/ftgzip.c +++ b/src/3rdparty/freetype/src/gzip/ftgzip.c @@ -8,7 +8,7 @@ /* parse compressed PCF fonts, as found with many X11 server */ /* distributions. */ /* */ -/* Copyright 2002-2006, 2009-2014 by */ +/* Copyright 2002-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -58,7 +58,6 @@ /* conflicts when a program is linked with both FreeType and the */ /* original ZLib. */ -#define NO_DUMMY_DECL #ifndef USE_ZLIB_ZCALLOC #define MY_ZCALLOC /* prevent all zcalloc() & zfree() in zutils.c */ #endif @@ -378,7 +377,10 @@ size = stream->read( stream, stream->pos, zip->input, FT_GZIP_BUFFER_SIZE ); if ( size == 0 ) + { + zip->limit = zip->cursor; return FT_THROW( Invalid_Stream_Operation ); + } } else { @@ -387,7 +389,10 @@ size = FT_GZIP_BUFFER_SIZE; if ( size == 0 ) + { + zip->limit = zip->cursor; return FT_THROW( Invalid_Stream_Operation ); + } FT_MEM_COPY( zip->input, stream->base + stream->pos, size ); } @@ -434,7 +439,8 @@ } else if ( err != Z_OK ) { - error = FT_THROW( Invalid_Stream_Operation ); + zip->limit = zip->cursor; + error = FT_THROW( Invalid_Stream_Operation ); break; } } @@ -558,19 +564,22 @@ stream->descriptor.pointer = NULL; } + + if ( !stream->read ) + FT_FREE( stream->base ); } - static FT_ULong - ft_gzip_stream_io( FT_Stream stream, - FT_ULong pos, - FT_Byte* buffer, - FT_ULong count ) + static unsigned long + ft_gzip_stream_io( FT_Stream stream, + unsigned long offset, + unsigned char* buffer, + unsigned long count ) { FT_GZipFile zip = (FT_GZipFile)stream->descriptor.pointer; - return ft_gzip_file_io( zip, pos, buffer, count ); + return ft_gzip_file_io( zip, offset, buffer, count ); } @@ -585,7 +594,7 @@ old_pos = stream->pos; if ( !FT_Stream_Seek( stream, stream->size - 4 ) ) { - result = FT_Stream_ReadULong( stream, &error ); + result = FT_Stream_ReadULongLE( stream, &error ); if ( error ) result = 0; @@ -686,7 +695,7 @@ stream->size = 0x7FFFFFFFL; /* don't know the real size! */ stream->pos = 0; - stream->base = 0; + stream->base = NULL; stream->read = ft_gzip_stream_io; stream->close = ft_gzip_stream_close; diff --git a/src/3rdparty/freetype/src/gzip/rules.mk b/src/3rdparty/freetype/src/gzip/rules.mk index 37cd991765..a8f74ec3c3 100644 --- a/src/3rdparty/freetype/src/gzip/rules.mk +++ b/src/3rdparty/freetype/src/gzip/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 2002, 2003, 2013 by +# Copyright 2002-2015 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -21,9 +21,14 @@ GZIP_DIR := $(SRC_DIR)/gzip # compilation flags for the driver # ifeq ($(SYSTEM_ZLIB),) - GZIP_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR)) + GZIP_COMPILE := $(CC) $(ANSIFLAGS) \ + $I$(subst /,$(COMPILER_SEP),$(GZIP_DIR)) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) else - GZIP_COMPILE := $(FT_COMPILE) + GZIP_COMPILE := $(CC) $(ANSIFLAGS) \ + $(INCLUDE_FLAGS) \ + $(FT_CFLAGS) endif diff --git a/src/3rdparty/freetype/src/gzip/zutil.h b/src/3rdparty/freetype/src/gzip/zutil.h index 1949270998..c9688cd9c0 100644 --- a/src/3rdparty/freetype/src/gzip/zutil.h +++ b/src/3rdparty/freetype/src/gzip/zutil.h @@ -182,7 +182,7 @@ typedef unsigned long ulg; #endif /* Diagnostic functions */ -#if defined(DEBUG) && !defined(_WIN32_WCE) +#ifdef DEBUG # include extern int z_verbose; extern void z_error OF((char *m)); -- cgit v1.2.3