summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/src/gzip
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/src/gzip')
-rw-r--r--src/3rdparty/freetype/src/gzip/Jamfile2
-rw-r--r--src/3rdparty/freetype/src/gzip/ftgzip.c31
-rw-r--r--src/3rdparty/freetype/src/gzip/rules.mk11
-rw-r--r--src/3rdparty/freetype/src/gzip/zutil.h2
4 files changed, 30 insertions, 16 deletions
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 <stdio.h>
extern int z_verbose;
extern void z_error OF((char *m));